File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 31
31
c . before :each do
32
32
# set to strictest setting for testing
33
33
# by default Puppet runs at warning level
34
- Puppet . settings [ :strict ] = :warning
34
+ # newer versions of Puppet remove :strict
35
+ Puppet . settings [ :strict ] = :warning if Puppet . settings . include? ( :strict )
35
36
end
36
37
end
37
38
Original file line number Diff line number Diff line change @@ -24,12 +24,13 @@ def stub_connection
24
24
@connection . stubs ( :Open ) . with ( 'Provider=SQLNCLI11;Initial Catalog=master;Application Name=Puppet;Data Source=.;DataTypeComptibility=80;User ID=sa;Password=Pupp3t1@' )
25
25
end
26
26
it 'should not raise an error but populate has_errors with message' do
27
- @connection . Errors . stubs ( :count ) . returns ( 1 )
28
- @connection . Errors . stubs ( :Description ) . returns ( "SQL Error in Connection" )
27
+ @connection . Errors . stubs ( :count ) . returns ( 2 )
28
+ @connection . expects ( :Errors ) . with ( 0 ) . returns ( stub ( { :Description => "SQL Error in Connection" } ) )
29
+ @connection . expects ( :Errors ) . with ( 1 ) . returns ( stub ( { :Description => "Rowdy Roddy Piper" } ) )
29
30
expect {
30
31
result = subject . open_and_run_command ( 'whacka whacka whacka' , config )
31
32
expect ( result . exitstatus ) . to eq ( 1 )
32
- expect ( result . error_message ) . to eq ( ' SQL Error in Connection' )
33
+ expect ( result . error_message ) . to eq ( " SQL Error in Connection\n Rowdy Roddy Piper" )
33
34
} . to_not raise_error ( Exception )
34
35
35
36
end
You can’t perform that action at this time.
0 commit comments