Skip to content

Commit

Permalink
Improve usage of fixture
Browse files Browse the repository at this point in the history
Use `.read` method instead of `File.read` for brevity
  • Loading branch information
tagliala committed Sep 14, 2024
1 parent b440ef0 commit 79f7b8b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion spec/heathen/processor_methods/convert_image_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

RSpec.describe Heathen::Processor do
let(:content) { File.read(fixture('heathen/quickfox.jpg')) }
let(:content) { fixture('heathen/quickfox.jpg').read }
let(:job) { Heathen::Job.new 'foo', content, 'en' }
let(:processor) { described_class.new job: job, logger: spec_logger }

Expand Down
2 changes: 1 addition & 1 deletion spec/heathen/processor_methods/htmltotext_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

RSpec.describe Heathen::Processor do
let(:content) { File.read(fixture('heathen/quickfox.html')) }
let(:content) { fixture('heathen/quickfox.html').read }
let(:job) { Heathen::Job.new 'foo', content, 'en' }
let(:processor) { described_class.new job: job, logger: Logger.new($stderr) }

Expand Down
12 changes: 6 additions & 6 deletions spec/heathen/processor_methods/libreoffice_spec.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
require 'spec_helper'

RSpec.describe Heathen::Processor do
let(:ms_word_content) { File.read(fixture('heathen/msword.docx')) }
let(:ms_spreadsheet_content) { File.read(fixture('heathen/msexcel.xlsx')) }
let(:ms_ppt_content) { File.read(fixture('heathen/mspowerpoint.pptx')) }
let(:oo_word_content) { File.read(fixture('heathen/ooword.odt')) }
let(:oo_spreadsheet_content) { File.read(fixture('heathen/oospreadsheet.ods')) }
let(:oo_presentation_content) { File.read(fixture('heathen/oopresentation.odp')) }
let(:ms_word_content) { fixture('heathen/msword.docx').read }
let(:ms_spreadsheet_content) { fixture('heathen/msexcel.xlsx').read }
let(:ms_ppt_content) { fixture('heathen/mspowerpoint.pptx').read }
let(:oo_word_content) { fixture('heathen/ooword.odt').read }
let(:oo_spreadsheet_content) { fixture('heathen/oospreadsheet.ods').read }
let(:oo_presentation_content) { fixture('heathen/oopresentation.odp').read }

def new_job(content)
@job = Heathen::Job.new 'foo', content, 'en'
Expand Down
2 changes: 1 addition & 1 deletion spec/heathen/processor_methods/pdftotext_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

RSpec.describe Heathen::Processor do
let(:content) { File.read(fixture('heathen/quickfox.pdf')) }
let(:content) { fixture('heathen/quickfox.pdf').read }
let(:job) { Heathen::Job.new 'foo', content, 'en' }
let(:processor) { described_class.new job: job, logger: Logger.new($stderr) }

Expand Down
2 changes: 1 addition & 1 deletion spec/heathen/processor_methods/tesseract_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

RSpec.describe Heathen::Processor do
let(:content) { File.read(fixture('heathen/quickfox.tiff')) }
let(:content) { fixture('heathen/quickfox.tiff').read }
let(:job) { Heathen::Job.new 'foo', content, 'en' }
let(:processor) { described_class.new job: job, logger: spec_logger }

Expand Down
2 changes: 1 addition & 1 deletion spec/heathen/processor_methods/wkhtmltopdf_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

RSpec.describe Heathen::Processor do
let(:content) { File.read(fixture('heathen/quickfox.html')) }
let(:content) { fixture('heathen/quickfox.html').read }
let(:job) { Heathen::Job.new 'foo', content, 'en' }
let(:processor) { described_class.new job: job, logger: spec_logger }

Expand Down

0 comments on commit 79f7b8b

Please sign in to comment.