Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/matchers/sourcepos_matchers.rb')
-rw-r--r--spec/support/matchers/sourcepos_matchers.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/support/matchers/sourcepos_matchers.rb b/spec/support/matchers/sourcepos_matchers.rb
new file mode 100644
index 00000000000..903fe2bd201
--- /dev/null
+++ b/spec/support/matchers/sourcepos_matchers.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+# remove data-sourcepos from compare
+RSpec::Matchers.define :eq_no_sourcepos do |expected|
+ include MarkdownHelpers
+
+ match do |actual|
+ remove_sourcepos(actual) == expected
+ end
+
+ description do
+ "equal ignoring sourcepos #{expected}"
+ end
+end