File tree Expand file tree Collapse file tree 1 file changed +27
-4
lines changed Expand file tree Collapse file tree 1 file changed +27
-4
lines changed Original file line number Diff line number Diff line change 33require 'spec_helper'
44
55describe '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+
621 let ( :nodes ) do
7- 'some_value_goes_here '
22+ 'pcp://target.example '
823 end
9- let ( :transport ) do
10- 'some_value_goes_here'
24+
25+ # Function testing depends on rspec-puppet magic in the opening describe
26+ # statement. Re-defining the subject just to give it a different name
27+ # would require duplicating rspec-puppet code, and that's a far worse sin.
28+ # rubocop:disable Rspec/NamedSubject
29+ it 'raises an error when nodes use the specified transport' do
30+ expect { subject . execute ( nodes , 'pcp' ) } . to raise_error ( Puppet ::PreformattedError , %r{target\. example uses pcp transport} )
1131 end
1232
13- xit { is_expected . to run . with_params ( nodes , transport ) . and_return ( 'some_value' ) }
33+ it 'raises no error when nodes do not use the specified transport' do
34+ expect { subject . execute ( nodes , 'ssh' ) } . not_to raise_error
35+ end
36+ # rubocop:enable Rspec/NamedSubject
1437end
You can’t perform that action at this time.
0 commit comments