Skip to content

Commit

Permalink
Fixing specs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyf committed Jun 5, 2023
1 parent df63e0d commit 2d0a5c2
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/services/iiif_print/derivative_rodeo_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class DerivativeRodeoService
class_attribute :parent_work_identifier_property_name, default: 'aark_id'

##
# @attr pre_processed_location_adapter_name [String] The name of a derivative rodeo storage location;
# @attr preprocessed_location_adapter_name [String] The name of a derivative rodeo storage location;
# this will must be a registered with the DerivativeRodeo::StorageLocations::BaseLocation.
class_attribute :pre_processed_location_adapter_name, default: 's3'
class_attribute :preprocessed_location_adapter_name, default: 's3'

##
# @attr named_derivatives_and_generators_by_type [Hash<Symbol, #constantize>] the named
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ services:
environment:
- VIRTUAL_PORT=3000
- VIRTUAL_HOST=.hyku.test
command: tail -f /dev/null
# command: tail -f /dev/null
##
## Similar to the above, except we will bundle and then tell the container
## to wait. You'll then need to bash into the web container to do much of
## anything.
# command: sh -l -c "bundle && echo \"Finished bundling now waiting...\" && tail -f /dev/null"
command: sh -l -c "bundle install && echo \"Finished bundling now waiting...\" && tail -f /dev/null"
depends_on:
db:
condition: service_started
Expand Down
2 changes: 1 addition & 1 deletion iiif_print.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SUMMARY
spec.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.add_dependency 'blacklight_iiif_search', '~> 1.0'
spec.add_dependency 'derivative-rodeo'
spec.add_dependency 'derivative-rodeo', "~> 0.3"
spec.add_dependency 'dry-monads', '~> 1.4.0'
spec.add_dependency 'hyrax', '>= 2.5', '< 4'
spec.add_dependency 'nokogiri', '>=1.13.2'
Expand Down
12 changes: 6 additions & 6 deletions lib/iiif_print/split_pdfs/derivative_rodeo_splitter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ module SplitPdfs
# @see .call
class DerivativeRodeoSplitter
##
# @param path [String] the local file location
# @param file_set [FileSet] file set containing a PDF file to split
# @param filename [String] the local path to the PDFDerivativeServicele
# @param file_set [FileSet] file set containing the PDF file to split
#
# @return [Array] paths to images split from each page of PDF file
def self.call(path, file_set:)
new(path, file_set: file_set).split_files
def self.call(filename, file_set:)
new(filename, file_set: file_set).split_files
end

def initialize(path, file_set:, output_tmp_dir: Dir.tmpdir)
@input_uri = "file://#{path}"
def initialize(filename, file_set:, output_tmp_dir: Dir.tmpdir)
@input_uri = "file://#{filename}"

# We are writing the images to a local location that CarrierWave can upload. This is a
# local file, internal to IiifPrint; it looks like SpaceStone/DerivativeRodeo lingo, but
Expand Down
3 changes: 2 additions & 1 deletion spec/iiif_print/split_pdfs/derivative_rodeo_splitter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

describe "instance" do
subject { described_class.new(path, file_set: file_set) }
let(:generator) { double(DerivativeRodeo::Generators::PdfSplitGenerator, generated_files: []) }

before do
allow(file_set).to receive(:parent).and_return(work)
Expand All @@ -26,7 +27,7 @@
it { is_expected.to respond_to :split_files }

it 'uses the rodeo to split' do
expect(DerivativeRodeo::Generators::PdfSplitGenerator).to receive(:new)
expect(DerivativeRodeo::Generators::PdfSplitGenerator).to receive(:new).and_return(generator)
described_class.call(path, file_set: file_set)
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/services/iiif_print/derivative_rodeo_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

subject(:klass) { described_class }

describe '.input_location_adapter_name' do
subject { described_class.input_location_adapter_name }
describe '.preprocessed_location_adapter_name' do
subject { described_class.preprocessed_location_adapter_name }
it { is_expected.to eq 's3' }
end

Expand Down

0 comments on commit 2d0a5c2

Please sign in to comment.