Object
# File lib/mspec/matchers/have_data.rb, line 5 def initialize(data) @data = data end
# File lib/mspec/matchers/have_data.rb, line 23 def failure_message ["Expected #{@name}", "to have data #{@data.pretty_inspect}"] end
# File lib/mspec/matchers/have_data.rb, line 9 def matches?(name) @name = name if FeatureGuard.enabled? :encoding size = @data.bytesize else size = @data.size end File.open @name, fmode("rb:binary") do |f| return f.read(size) == @data end end
# File lib/mspec/matchers/have_data.rb, line 28 def negative_failure_message ["Expected #{@name}", "not to have data #{@data.pretty_inspect}"] end
[Validate]
Generated with the Darkfish Rdoc Generator 2.