Skip to content

Commit

Permalink
Fix failing specs
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <tsmith@chef.io>
  • Loading branch information
tas50 committed Dec 29, 2016
1 parent 6c7f7bc commit 1f82680
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion recipes/default.rb
Expand Up @@ -21,7 +21,7 @@
package 'rsyslog-relp' if node['rsyslog']['use_relp']

if node['rsyslog']['enable_tls'] && node['rsyslog']['tls_ca_file']
Chef::Log.fatal("Recipe rsyslog::default can not use 'enable_tls' with protocol '#{node['rsyslog']['protocol']}' (requires 'tcp')") unless node['rsyslog']['protocol'] == 'tcp'
raise "Recipe rsyslog::default can not use 'enable_tls' with protocol '#{node['rsyslog']['protocol']}' (requires 'tcp')" unless node['rsyslog']['protocol'] == 'tcp'
package 'rsyslog-gnutls'
end

Expand Down
9 changes: 3 additions & 6 deletions spec/default_spec.rb
Expand Up @@ -49,11 +49,6 @@
end

context "when protocol is not 'tcp'" do
before do
allow(Chef::Log).to receive(:fatal)
allow($stdout).to receive(:puts)
end

let(:chef_run) do
ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |node|
node.normal['rsyslog']['enable_tls'] = true
Expand All @@ -63,7 +58,9 @@
end

it 'exits fatally' do
expect { chef_run }.to raise_error(SystemExit)
expect do
chef_run
end.to raise_error
end
end
end
Expand Down

0 comments on commit 1f82680

Please sign in to comment.