Sha256: 845042d8e0a73db107b4ca5b3c4f186b79e72a82b54c780a453ce7b464650f39

Contents?: true

Size: 850 Bytes

Versions: 5

Compression:

Stored size: 850 Bytes

Contents

# @!method be_an_absolute_path
#   This matchers checks if <path> exists in filesystem
#
#   @return [Boolean] The result
#
#     false:
#     * if path is not absolute
#     true:
#     * if path is absolute
#
#   @example Use matcher
#
#     RSpec.describe do
#       it { expect(file).to be_an_absolute_path }
#       it { expect(directory).to be_an_absolute_path }
#       it { expect(directories).to include an_absolute_path }
#     end
RSpec::Matchers.define :be_an_absolute_path do |_|
  match do |actual|
    absolute?(actual)
  end

  failure_message do |actual|
    format("expected that path \"%s\" is absolute, but it's not", actual)
  end

  failure_message_when_negated do |actual|
    format('expected that path "%s" is not absolute, but it is', actual)
  end
end

RSpec::Matchers.alias_matcher :an_absolute_path, :be_an_absolute_path

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/aruba-2.2.0/lib/aruba/matchers/path/be_an_absolute_path.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/aruba-2.2.0/lib/aruba/matchers/path/be_an_absolute_path.rb
aruba-2.2.0 lib/aruba/matchers/path/be_an_absolute_path.rb
aruba-2.1.0 lib/aruba/matchers/path/be_an_absolute_path.rb
aruba-2.0.1 lib/aruba/matchers/path/be_an_absolute_path.rb