|
26 | 26 | it "respects the page parameter" do |
27 | 27 | # create a multi-layer image |
28 | 28 | tiff = Tempfile.new(["file", ".tiff"]) |
29 | | - MiniMagick::Tool::Convert.new do |convert| |
| 29 | + MiniMagick::Tool.new('convert') do |convert| |
30 | 30 | convert.merge! [landscape_file_path, landscape_file_path, landscape_file_path] |
31 | 31 | convert << tiff.path |
32 | 32 | end |
|
58 | 58 | end |
59 | 59 |
|
60 | 60 | it "scales up the image if it smaller than the given dimensions" do |
61 | | - expect(::MiniMagick::Tool::Identify.new.verbose(instance.current_path).call).to_not include('Quality: 70') |
| 61 | + expect(::MiniMagick::Tool.new('identify').verbose(instance.current_path).call).to_not include('Quality: 70') |
62 | 62 |
|
63 | 63 | instance.resize_to_fill(1000, 1000, combine_options: { saver: { quality: 70 } }) |
64 | 64 |
|
65 | 65 | expect(instance).to have_dimensions(1000, 1000) |
66 | | - expect(::MiniMagick::Tool::Identify.new.verbose(instance.current_path).call).to include('Quality: 70') |
| 66 | + expect(::MiniMagick::Tool.new('identify').verbose(instance.current_path).call).to include('Quality: 70') |
67 | 67 | end |
68 | 68 | end |
69 | 69 |
|
|
116 | 116 | end |
117 | 117 |
|
118 | 118 | it 'accepts combine_options and set quality' do |
119 | | - expect(::MiniMagick::Tool::Identify.new.verbose(instance.current_path).call).to_not include('Quality: 70') |
| 119 | + expect(::MiniMagick::Tool.new('identify').verbose(instance.current_path).call).to_not include('Quality: 70') |
120 | 120 |
|
121 | 121 | instance.resize_and_pad(1000, 1000, combine_options: { saver: { quality: 70 } }) |
122 | 122 |
|
123 | 123 | expect(instance).to have_dimensions(1000, 1000) |
124 | | - expect(::MiniMagick::Tool::Identify.new.verbose(instance.current_path).call).to include('Quality: 70') |
| 124 | + expect(::MiniMagick::Tool.new('identify').verbose(instance.current_path).call).to include('Quality: 70') |
125 | 125 | end |
126 | 126 |
|
127 | 127 | it 'accepts non-argument option as combine_options' do |
128 | | - expect(::MiniMagick::Tool::Identify.new.verbose(instance.current_path).call).to include('exif:ColorSpace: 1') |
| 128 | + expect(::MiniMagick::Tool.new('identify').verbose(instance.current_path).call).to include('exif:ColorSpace: 1') |
129 | 129 |
|
130 | 130 | instance.resize_and_pad(1000, 1000, combine_options: { saver: { strip: true } }) |
131 | 131 |
|
132 | 132 | expect(instance).to have_dimensions(1000, 1000) |
133 | | - expect(::MiniMagick::Tool::Identify.new.verbose(instance.current_path).call).to_not include('exif:ColorSpace: 1') |
| 133 | + expect(::MiniMagick::Tool.new('identify').verbose(instance.current_path).call).to_not include('exif:ColorSpace: 1') |
134 | 134 | end |
135 | 135 | end |
136 | 136 |
|
|
152 | 152 | end |
153 | 153 |
|
154 | 154 | it 'scales up the image if it smaller than the given dimensions and set quality' do |
155 | | - expect(::MiniMagick::Tool::Identify.new.verbose(instance.current_path).call).to_not include('Quality: 70') |
| 155 | + expect(::MiniMagick::Tool.new('identify').verbose(instance.current_path).call).to_not include('Quality: 70') |
156 | 156 |
|
157 | 157 | instance.resize_to_fit(1000, 1000, combine_options: { saver: { quality: 70} }) |
158 | 158 |
|
159 | 159 | expect(instance).to have_dimensions(1000, 750) |
160 | | - expect(::MiniMagick::Tool::Identify.new.verbose(instance.current_path).call).to include('Quality: 70') |
| 160 | + expect(::MiniMagick::Tool.new('identify').verbose(instance.current_path).call).to include('Quality: 70') |
161 | 161 | end |
162 | 162 | end |
163 | 163 |
|
164 | 164 | describe '#resize_to_limit' do |
165 | 165 | it 'resizes the image to fit within the given dimensions, maintain file type and set quality' do |
166 | | - expect(::MiniMagick::Tool::Identify.new.verbose(instance.current_path).call).to_not include('Quality: 70') |
| 166 | + expect(::MiniMagick::Tool.new('identify').verbose(instance.current_path).call).to_not include('Quality: 70') |
167 | 167 |
|
168 | 168 | instance.resize_to_limit(200, 200, combine_options: { saver: { quality: 70} }) |
169 | 169 |
|
170 | 170 | expect(instance).to have_dimensions(200, 150) |
171 | 171 | expect(::Vips::Image.new_from_file(instance.current_path).get("vips-loader")).to match(/jpeg/) |
172 | | - expect(::MiniMagick::Tool::Identify.new.verbose(instance.current_path).call).to include('Quality: 70') |
| 172 | + expect(::MiniMagick::Tool.new('identify').verbose(instance.current_path).call).to include('Quality: 70') |
173 | 173 | end |
174 | 174 |
|
175 | 175 | it "resizes the image to fit within the given dimensions and maintain updated file type" do |
|
0 commit comments