Sha256: b660c75c55400e528a03179247658d53eceabf325e8ae6d66fd8737591c41a0a

Contents?: true

Size: 639 Bytes

Versions: 9

Compression:

Stored size: 639 Bytes

Contents

module FileMacros
  module ExampleMethods

    def files_should_be_identical(first, second)
      identical_files?(first, second).should be(true)
    end

    def files_should_not_be_identical(first, second)
      identical_files?(first, second).should be(false)
    end

    def file_should_exist(file)
      File.exists?(file).should be(true)
    end

    def file_should_not_exist(file)
      File.exists?(file).should be(false)
    end

    def identical_files?(first, second)
      open(second, 'r').read.should == open(first, 'r').read
    end
  end

  def self.included(receiver)
    receiver.send :include, ExampleMethods
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ajax-1.0.8 spec/support/file_macros.rb
ajax-1.0.7 spec/support/file_macros.rb
ajax-1.0.6 spec/support/file_macros.rb
ajax-1.0.5 spec/support/file_macros.rb
ajax-1.0.4 spec/support/file_macros.rb
ajax-1.0.3 spec/support/file_macros.rb
ajax-1.0.2 spec/support/file_macros.rb
ajax-1.0.1 spec/support/file_macros.rb
ajax-0.1.7 spec/support/file_macros.rb