spec/beaker/dsl/helpers_spec.rb in beaker-1.3.2 vs spec/beaker/dsl/helpers_spec.rb in beaker-1.4.0

- old
+ new

@@ -357,9 +357,28 @@ 'class { "boo": }', :trace => true, :catch_changes => true ) end + it 'enforces a 2 exit code through :expect_changes' do + subject.should_receive( :create_remote_file ).and_return( true ) + subject.should_receive( :puppet ). + with( 'apply', '--verbose', '--trace', '--detailed-exitcodes', /apply_manifest.\d+.pp/ ). + and_return( 'puppet_command' ) + + subject.should_receive( :on ).with( + 'my_host', + 'puppet_command', + :acceptable_exit_codes => [2] + ) + + subject.apply_manifest_on( + 'my_host', + 'class { "boo": }', + :trace => true, + :expect_changes => true + ) + end it 'enforces exit codes through :expect_failures' do subject.should_receive( :create_remote_file ).and_return( true ) subject.should_receive( :puppet ). with( 'apply', '--verbose', '--trace', '--detailed-exitcodes', /apply_manifest.\d+.pp/ ). and_return( 'puppet_command' )