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/be_boolean.rb')
-rw-r--r--spec/support/matchers/be_boolean.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/support/matchers/be_boolean.rb b/spec/support/matchers/be_boolean.rb
new file mode 100644
index 00000000000..b8c2c385504
--- /dev/null
+++ b/spec/support/matchers/be_boolean.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+# Assert that this value is a boolean, i.e. true or false
+#
+# ```
+# expect(value).to be_boolean
+# ```
+RSpec::Matchers.define :be_boolean do
+ match { |value| value.in? [true, false] }
+end