improve test, also ensure no zero size is generated

This commit is contained in:
Sam 2018-10-23 08:50:07 +11:00
parent bea8d337b2
commit adab7a3a48
1 changed files with 3 additions and 1 deletions

View File

@ -47,7 +47,9 @@ describe OptimizedImage do
filename: "test.png"
)
expect(orig_size).to be > File.size(original_path)
new_size = File.size(original_path)
expect(orig_size).to be > new_size
expect(new_size).not_to eq(0)
ensure
File.delete(original_path) if File.exists?(original_path)