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

- old
+ new

@@ -296,81 +296,81 @@ end end describe '#apply_manifest_on' do it 'calls puppet' do + subject.should_receive( :create_remote_file ).and_return( true ) subject.should_receive( :puppet ). - with( 'apply', '--verbose'). + with( 'apply', '--verbose', /apply_manifest.\d+.pp/ ). and_return( 'puppet_command' ) subject.should_receive( :on ). with( 'my_host', 'puppet_command', - :acceptable_exit_codes => [0], - :stdin => "class { \"boo\": }\n" ) + :acceptable_exit_codes => [0] ) subject.apply_manifest_on( 'my_host', 'class { "boo": }') end it 'adds acceptable exit codes with :catch_failures' do + subject.should_receive( :create_remote_file ).and_return( true ) subject.should_receive( :puppet ). - with( 'apply', '--verbose', '--trace', '--detailed-exitcodes' ). + 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 => [0,2], - :stdin => "class { \"boo\": }\n" ) + :acceptable_exit_codes => [0,2] ) subject.apply_manifest_on( 'my_host', 'class { "boo": }', :trace => true, :catch_failures => true ) end it 'allows acceptable exit codes through :catch_failures' do + subject.should_receive( :create_remote_file ).and_return( true ) subject.should_receive( :puppet ). - with( 'apply', '--verbose', '--trace', '--detailed-exitcodes' ). + 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 => [4,0,2], - :stdin => "class { \"boo\": }\n" ) + :acceptable_exit_codes => [4,0,2] ) subject.apply_manifest_on( 'my_host', '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( :create_remote_file ).and_return( true ) subject.should_receive( :puppet ). - with( 'apply', '--verbose', '--trace', '--detailed-exitcodes' ). + 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 => [0], - :stdin => "class { \"boo\": }\n" + :acceptable_exit_codes => [0] ) 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( :create_remote_file ).and_return( true ) subject.should_receive( :puppet ). - with( 'apply', '--verbose', '--trace', '--detailed-exitcodes' ). + 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 => [1,4,6], - :stdin => "class { \"boo\": }\n" + :acceptable_exit_codes => [1,4,6] ) subject.apply_manifest_on( 'my_host', 'class { "boo": }', @@ -388,18 +388,18 @@ :catch_failures => true ) }.to raise_error ArgumentError, /catch_failures.+expect_failures/ end it 'enforces added 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' ). + 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 => [1,2,3,4,5,6], - :stdin => "class { \"boo\": }\n" + :acceptable_exit_codes => [1,2,3,4,5,6] ) subject.apply_manifest_on( 'my_host', 'class { "boo": }',