Sha256: cb828b3cdf0e593c0ef924c1c4ccb195a301b15c097ba2aa04fa0c422218773d

Contents?: true

Size: 413 Bytes

Versions: 14

Compression:

Stored size: 413 Bytes

Contents

require 'pathname'

RSpec::Matchers.define :be_relative_path do
  match do |given|
    if given.nil?
      false
    else
      Pathname.new(given).relative?
    end
  end

  failure_message do |given|
    "Expected '#{given}' to be a relative path but got an absolute path."
  end

  failure_message_when_negated do |given|
    "Expected '#{given}' to not be a relative path but got an absolute path."
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ridley-5.1.1 spec/support/filepath_matchers.rb
ridley-5.1.0 spec/support/filepath_matchers.rb
ridley-5.0.0 spec/support/filepath_matchers.rb
ridley-4.6.1 spec/support/filepath_matchers.rb
ridley-4.6.0 spec/support/filepath_matchers.rb
ridley-4.5.1 spec/support/filepath_matchers.rb
ridley-4.5.0 spec/support/filepath_matchers.rb
ridley-4.4.3 spec/support/filepath_matchers.rb
ridley-4.4.2 spec/support/filepath_matchers.rb
ridley-4.4.1 spec/support/filepath_matchers.rb
ridley-4.4.0 spec/support/filepath_matchers.rb
ridley-4.3.2 spec/support/filepath_matchers.rb
ridley-4.3.1 spec/support/filepath_matchers.rb
ridley-4.3.0 spec/support/filepath_matchers.rb