File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change 3
3
require 'spec_helper'
4
4
5
5
describe 'peadm::fail_on_transport' do
6
+ include BoltSpec ::BoltContext
7
+
8
+ around :each do |example |
9
+ in_bolt_context do
10
+ example . run
11
+ end
12
+ end
13
+
14
+ # NOTE: If https://github.com/puppetlabs/bolt/issues/3184
15
+ # is fixed, this will start causing a duplicate declaration
16
+ # error. If that happens, delete this pre_condition.
17
+ let ( :pre_condition ) do
18
+ 'type TargetSpec = Boltlib::TargetSpec'
19
+ end
20
+
6
21
let ( :nodes ) do
7
- 'some_value_goes_here '
22
+ 'pcp://target.example '
8
23
end
9
- let ( :transport ) do
10
- 'some_value_goes_here'
24
+
25
+ it 'raises an error when nodes use the specified transport' do
26
+ expect { subject . execute ( nodes , 'pcp' ) } . to raise_error ( Puppet ::PreformattedError , /target\. example uses pcp transport/ )
11
27
end
12
28
13
- xit { is_expected . to run . with_params ( nodes , transport ) . and_return ( 'some_value' ) }
29
+ it 'raises no error when nodes do not use the specified transport' do
30
+ expect { subject . execute ( nodes , 'ssh' ) } . to_not raise_error
31
+ end
14
32
end
You can’t perform that action at this time.
0 commit comments