Sha256: a6405946c1e44e1f14fe16cbb6f3fe301780696ffa0d9d21289d24097951237c

Contents?: true

Size: 426 Bytes

Versions: 161

Compression:

Stored size: 426 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_for_should do |given|
    "Expected '#{given}' to be a relative path but got an absolute path."
  end

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

Version data entries

161 entries across 161 versions & 2 rubygems

Version Path
ridley-4.2.0 spec/support/filepath_matchers.rb
ridley-4.1.2 spec/support/filepath_matchers.rb
ridley-4.1.1 spec/support/filepath_matchers.rb
ridley-4.1.0 spec/support/filepath_matchers.rb
berkshelf-3.1.5 spec/support/matchers/filepath_matchers.rb
berkshelf-3.1.4 spec/support/matchers/filepath_matchers.rb
berkshelf-2.0.18 spec/support/matchers/filepath_matchers.rb
berkshelf-2.0.17 spec/support/matchers/filepath_matchers.rb
berkshelf-3.1.3 spec/support/matchers/filepath_matchers.rb
ridley-4.0.0 spec/support/filepath_matchers.rb
berkshelf-3.1.2 spec/support/matchers/filepath_matchers.rb
berkshelf-2.0.16 spec/support/matchers/filepath_matchers.rb
berkshelf-3.1.1 spec/support/matchers/filepath_matchers.rb
ridley-3.1.0 spec/support/filepath_matchers.rb
berkshelf-3.1.0 spec/support/matchers/filepath_matchers.rb
berkshelf-3.0.1 spec/support/matchers/filepath_matchers.rb
berkshelf-3.0.0 spec/support/matchers/filepath_matchers.rb
berkshelf-2.0.15 spec/support/matchers/filepath_matchers.rb
berkshelf-3.0.0.rc1 spec/support/matchers/filepath_matchers.rb
berkshelf-3.0.0.beta9 spec/support/matchers/filepath_matchers.rb