diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-14 15:07:55 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-14 15:07:55 +0000 |
commit | 85e494935a8726dc98bb19ffa584488420e5011e (patch) | |
tree | 5acf279dab81a2363e4504a9679c32c16510542b /spec/support/matchers | |
parent | 4ce0bee95df15c05cdb0d777eba31fe753bc443b (diff) | |
download | gitlab-ce-85e494935a8726dc98bb19ffa584488420e5011e.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/matchers')
-rw-r--r-- | spec/support/matchers/eq_uri.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/support/matchers/eq_uri.rb b/spec/support/matchers/eq_uri.rb new file mode 100644 index 00000000000..47b657b3fe1 --- /dev/null +++ b/spec/support/matchers/eq_uri.rb @@ -0,0 +1,19 @@ +# 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 |