spec/models/riiif/image_spec.rb in riiif-2.3.0 vs spec/models/riiif/image_spec.rb in riiif-2.4.0
- old
+ new
@@ -26,16 +26,22 @@
expect(subject.render('size' => 'full', format: 'jpg')).to eq 'imagedata'
end
end
it 'is able to override the file used for the Image' do
+ allow(Riiif::CommandRunner).to receive(:execute)
+ .with("identify -format '%h %w %m %[channels]' #{filename}[0]").and_return('400 800')
+
img = described_class.new('some_id', Riiif::File.new(filename))
expect(img.id).to eq 'some_id'
expect(img.info).to eq Riiif::ImageInformation.new(width: 800, height: 400)
end
describe 'info' do
it 'returns the data' do
+ allow(Riiif::CommandRunner).to receive(:execute)
+ .with("identify -format '%h %w %m %[channels]' #{filename}[0]").and_return('400 800')
+
expect(subject.info).to eq Riiif::ImageInformation.new(width: 800, height: 400)
end
end
context 'using HttpFileResolver' do