wvanbergen / chunky_png

Read/write access to PNG images in pure Ruby.
https://chunkypng.com
MIT License
1.05k stars 101 forks source link

Expect ChunkyPNG::CRCMismatch in datastream spec #101

Closed lencioni closed 9 years ago

lencioni commented 9 years ago

When running RSpec, I noticed the following warning:

WARNING: Using the raise_error matcher without providing a specific error or message risks false positives, since raise_error will match when Ruby raises a NoMethodError, NameError or ArgumentError, potentially allowing the expectation to pass without even executing the method you are intending to call. Instead consider providing a specific error class or message. This message can be supressed by setting: RSpec::Expectations.configuration.warn_about_potential_false_positives = false. Called from /path/to/chunky_png/spec/chunky_png/datastream_spec.rb:13:in `block (3 levels) in <top (required)>'.

I noticed that it was raising a ChunkyPNG::CRCMismatch error, so I decided it would be best to just include that detail in the matcher.

wvanbergen commented 9 years ago

:+1: thanks!