Sha256: 475c782ec3eeee76099007f838876388e19612f688487481368606f36bb93894

Contents?: true

Size: 441 Bytes

Versions: 69

Compression:

Stored size: 441 Bytes

Contents

RSpec::Matchers.define :match_realpath do |expected|

  match do |actual|
    actual == expected || realpath(actual) == realpath(expected)
  end

  failure_message do |actual|
    "expected that #{actual} would have a real path of #{expected}"
  end

  failure_message_when_negated do |actual|
    "expected that #{actual} would not have a real path of #{expected}"
  end

  def realpath(path)
    Pathname.new(path).realpath.to_s
  end
end

Version data entries

69 entries across 69 versions & 2 rubygems

Version Path
r10k-2.2.1 spec/matchers/match_realpath.rb
r10k-2.2.0 spec/matchers/match_realpath.rb
r10k-2.1.1 spec/matchers/match_realpath.rb
r10k-2.1.0 spec/matchers/match_realpath.rb
r10k-2.0.3 spec/matchers/match_realpath.rb
r10k-2.0.2 spec/matchers/match_realpath.rb
r10k-2.0.1 spec/matchers/match_realpath.rb
r10k-2.0.0 spec/matchers/match_realpath.rb
r10k-1.5.1 spec/matchers/match_realpath.rb