blob: 94ebe797068dd073795775f62cf606764d23af9d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
require 'minitest/autorun'
require 'socket'
require_relative '../../../lib/dsl'
class RCMOnlyWhenTest < Minitest::Test
def test_hostname
rcm = configure_from_scratch do
only_when { hostname Socket.gethostname }
end
assert rcm.conds_met
end
def test_hostname_negative
rcm = configure_from_scratch do
only_when { hostname "#{Socket.gethostname}.invalid" }
end
refute rcm.conds_met
end
end
|