summaryrefslogtreecommitdiff
path: root/test/lib/dslkeywords/given_test.rb
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-02-19 01:29:01 +0200
committerPaul Buetow <paul@buetow.org>2025-02-19 01:29:01 +0200
commite37f1d7dfeb3ff40ee80c6e097cae30b9ec512c4 (patch)
tree2e9f9a63b799f1e8901fdd6d08f09b7665cd6ab5 /test/lib/dslkeywords/given_test.rb
parent13657c3c13dc62d6aba6e0633fc7f99e44170c06 (diff)
more on this
Diffstat (limited to 'test/lib/dslkeywords/given_test.rb')
-rw-r--r--test/lib/dslkeywords/given_test.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/lib/dslkeywords/given_test.rb b/test/lib/dslkeywords/given_test.rb
new file mode 100644
index 0000000..d27baca
--- /dev/null
+++ b/test/lib/dslkeywords/given_test.rb
@@ -0,0 +1,20 @@
+require 'minitest/autorun'
+require 'socket'
+
+require_relative '../../../lib/dsl'
+
+class RCMOnlyWhenTest < Minitest::Test
+ def test_hostname
+ rcm = configure_from_scratch do
+ given { hostname Socket.gethostname }
+ end
+ assert rcm.conds_met
+ end
+
+ def test_hostname_negative
+ rcm = configure_from_scratch do
+ given { hostname "#{Socket.gethostname}.invalid" }
+ end
+ refute rcm.conds_met
+ end
+end