summaryrefslogtreecommitdiff
path: root/spec/support/matchers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-14 15:07:55 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-14 15:07:55 +0000
commit85e494935a8726dc98bb19ffa584488420e5011e (patch)
tree5acf279dab81a2363e4504a9679c32c16510542b /spec/support/matchers
parent4ce0bee95df15c05cdb0d777eba31fe753bc443b (diff)
downloadgitlab-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.rb19
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