spec/support/image_matchers.rb in dragonfly-0.9.0 vs spec/support/image_matchers.rb in dragonfly-0.9.1
- old
+ new
@@ -43,5 +43,15 @@
RSpec::Matchers.define :have_size do |size|
match do |given|
image_properties(given)[:size].should == size
end
end
+
+RSpec::Matchers.define :equal_image do |other|
+ match do |given|
+ image_data = given.open.read
+ other_image_data = other.open.read
+ given.close
+ other.close
+ image_data == other_image_data
+ end
+end