Skip to content

Commit

Permalink
test(operation/straighten): add test coverage for negative angle and …
Browse files Browse the repository at this point in the history
…vertical image

- negative angle seemed prudent
- vertical image validates the code for choosing longer edge for scaling and therefore preventing insufficient zooming
  • Loading branch information
knarewski committed Sep 30, 2024
1 parent b207ebd commit 398193a
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions spec/morandi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,35 @@
describe 'when given a straighten option' do
let(:options) { { 'straighten' => 5 } }

it 'should reduce the straighten images' do
it 'straightens images' do
process_image

expect(File).to exist(file_out)
expect(processed_image_type).to eq('jpeg')
end

context 'with a negative straighten value' do
let(:options) { { 'straighten' => -20 } }

it 'straightens images' do
process_image

expect(File).to exist(file_out)
expect(processed_image_type).to eq('jpeg')
end
end

context 'with vertical image' do
let(:original_image_width) { 100 }
let(:original_image_height) { 400 }

it 'straightens images' do
process_image

expect(File).to exist(file_out)
expect(processed_image_type).to eq('jpeg')
end
end
end

describe 'when given a gamma option' do
Expand Down Expand Up @@ -331,7 +354,7 @@
100))).to be_greyish
end

context 'with a black image and invalid spots' do
context 'with a gray image and invalid spots' do
let(:file_arg) { solid_colour_image(800, 800, 0x666666ff) }
let(:options) { { 'redeye' => [[540, 650], [-100, 100]] } }

Expand Down

0 comments on commit 398193a

Please sign in to comment.