spec/beaker/dsl/helpers_spec.rb in beaker-1.2.0 vs spec/beaker/dsl/helpers_spec.rb in beaker-1.3.0
- old
+ new
@@ -338,9 +338,28 @@
'class { "boo": }',
:acceptable_exit_codes => [4],
:trace => true,
:catch_failures => true )
end
+ it 'enforces a 0 exit code through :catch_changes' do
+ subject.should_receive( :puppet ).
+ with( 'apply', '--verbose', '--trace', '--detailed-exitcodes' ).
+ and_return( 'puppet_command' )
+
+ subject.should_receive( :on ).with(
+ 'my_host',
+ 'puppet_command',
+ :acceptable_exit_codes => [0],
+ :stdin => "class { \"boo\": }\n"
+ )
+
+ subject.apply_manifest_on(
+ 'my_host',
+ 'class { "boo": }',
+ :trace => true,
+ :catch_changes => true
+ )
+ end
it 'enforces exit codes through :expect_failures' do
subject.should_receive( :puppet ).
with( 'apply', '--verbose', '--trace', '--detailed-exitcodes' ).
and_return( 'puppet_command' )