Sha256: 417f713ceaf91dfeb7f6d84bd58c8218cac0c11914e25c0a90e022c99feff0ed
Contents?: true
Size: 574 Bytes
Versions: 11
Compression:
Stored size: 574 Bytes
Contents
module RSpec::RubyContentMatchers class HaveContent attr_accessor :file_path def initialize end def matches?(file_path, &block) self.file_path = file_path return nil if File.blank? file_path file = File.new(file_path) yield file.read if block true end def failure_message "Expected the file #{file_path} to have content" end def negative_failure_message "Did not expect the file #{file_path} to have content" end end def have_content HaveContent.new end end
Version data entries
11 entries across 11 versions & 1 rubygems