debian-mirror-gitlab/spec/support/matchers/eq_uri.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
381 B
Ruby
Raw Normal View History

2020-03-09 13:42:32 +05:30
# frozen_string_literal: true
# Assert the result matches a URI object initialized with the expectation variable.
#
# Success:
# ```
# expect(URI('www.fish.com')).to eq_uri('www.fish.com')
# ```
#
# Failure:
# ```
# expect(URI('www.fish.com')).to eq_uri('www.dog.com')
# ```
#
RSpec::Matchers.define :eq_uri do |expected|
match do |actual|
actual == URI(expected)
end
end