Skip to content

Commit

Permalink
Update tests to ignore warnings but still look for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Fields committed Jun 2, 2014
1 parent dacbe81 commit cf9fa00
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
9 changes: 5 additions & 4 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

# Apply twice to ensure no errors the second time.
apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stderr).to eq("")
expect(r.stderr).not_to match(/error/i)
end
apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stderr).to eq("")
expect(r.stderr).not_to eq(/error/i)

expect(r.exit_code).to be_zero
end
end
Expand All @@ -19,7 +20,7 @@
pp = "class { 'ntp': service_ensure => stopped }"

apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stderr).to eq("")
expect(r.stderr).not_to match(/error/i)
end
end
end
Expand All @@ -29,7 +30,7 @@
pp = "class { 'ntp': service_ensure => running }"

apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stderr).to eq("")
expect(r.stderr).not_to match(/error/i)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/ntp_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
pp = "class { 'ntp': }"

apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stderr).to eq("")
expect(r.stderr).not_to match(/error/i)
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/preferred_servers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class { '::ntp':

it 'applies cleanly' do
apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stderr).to eq("")
expect(r.stderr).not_to match(/error/i)
end
end

Expand Down
3 changes: 2 additions & 1 deletion spec/acceptance/restrict_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
it 'runs twice' do
2.times do
apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stderr).to be_empty
expect(r.stderr).not_to match(/error/i)
expect(r.exit_code).to be_zero
end
end
end
Expand Down

0 comments on commit cf9fa00

Please sign in to comment.