Sha256: 51398dd9b91cf95e673626b1ad390c27db655d6ec7ae34dac4df97fdae6dea87

Contents?: true

Size: 655 Bytes

Versions: 27

Compression:

Stored size: 655 Bytes

Contents

RSpec::Matchers.define :be_existing_file do |_|
  match { |actual| File.file?(actual) }

  failure_message do |actual|
    format("expected that file \"%s\" exists", actual)
  end

  failure_message_when_negated do |actual|
    format("expected that file \"%s\" does not exist", actual)
  end
end

RSpec::Matchers.define :have_content do |expected|
  match { |actual| File.read(actual).chomp == expected.chomp }

  failure_message do |actual|
    format("expected that file \"%s\" contains:\n%s", actual, expected)
  end

  failure_message_when_negated do |actual|
    format("expected that file \"%s\" does not contain:\n%s", actual, expected)
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
proxy_pac_rb-0.9.1 spec/support/matchers/file.rb
proxy_pac_rb-0.8.2 spec/support/matchers/file.rb
proxy_pac_rb-0.8.1 spec/support/matchers/file.rb
proxy_pac_rb-0.8.0 spec/support/matchers/file.rb
proxy_pac_rb-0.7.0 spec/support/matchers/file.rb
proxy_pac_rb-0.6.9 spec/support/matchers/file.rb
proxy_pac_rb-0.6.8 spec/support/matchers/file.rb
proxy_pac_rb-0.6.7 spec/support/matchers/file.rb
proxy_pac_rb-0.6.5 spec/support/matchers/file.rb
proxy_pac_rb-0.6.4 spec/support/matchers/file.rb
proxy_pac_rb-0.6.3 spec/support/matchers/file.rb
proxy_pac_rb-0.6.2 spec/support/matchers/file.rb
proxy_pac_rb-0.6.1 spec/support/matchers/file.rb
proxy_pac_rb-0.6.0 spec/support/matchers/file.rb
proxy_pac_rb-0.5.10 spec/support/matchers/file.rb
proxy_pac_rb-0.5.9 spec/support/matchers/file.rb
proxy_pac_rb-0.5.8 spec/support/matchers/file.rb
proxy_pac_rb-0.5.7 spec/support/matchers/file.rb
proxy_pac_rb-0.5.6 spec/support/matchers/file.rb
proxy_pac_rb-0.5.5 spec/support/matchers/file.rb