Skip to content

Commit

Permalink
Fix up nexus::config
Browse files Browse the repository at this point in the history
Found a couple of resource name spelling mistakes while writing unit
tests

Signed-off-by: Andrew Grimberg <[email protected]>
  • Loading branch information
tykeal committed Oct 1, 2015
1 parent 84b4ffa commit 2da78c0
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@

$nexus_properties_file = "${nexus_root}/${nexus_home_dir}/conf/nexus.properties"

file_line{ 'nexus-appliction-host':
file_line{ 'nexus-application-host':
path => $nexus_properties_file,
match => '^application-host',
line => "application-host=${nexus_host}"
}

file_line{ 'nexus-appliction-port':
file_line{ 'nexus-application-port':
path => $nexus_properties_file,
match => '^application-port',
line => "application-port=${nexus_port}"
Expand Down
53 changes: 53 additions & 0 deletions spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
require 'spec_helper'

describe 'nexus::config', :type => :class do
let(:params) {
{
'nexus_root' => '/foo',
'nexus_home_dir' => '/bar',
'nexus_host' => '1.1.1.1',
'nexus_port' => '8888',
'nexus_context' => '/baz',
'nexus_work_dir' => '/foom',
}
}

context 'no params set' do
let(:params) {{}}

it 'should fail' do
expect { should compile }.to raise_error(RSpec::Expectations::ExpectationNotMetError,
/Must pass /)
end
end

context 'with test values' do
it { should contain_class('nexus::config') }

it { should contain_file_line('nexus-application-host').with(
'path' => '/foo//bar/conf/nexus.properties',
'match' => '^application-host',
'line' => 'application-host=1.1.1.1',
) }

it { should contain_file_line('nexus-application-port').with(
'path' => '/foo//bar/conf/nexus.properties',
'match' => '^application-port',
'line' => 'application-port=8888',
) }

it { should contain_file_line('nexus-webapp-context-path').with(
'path' => '/foo//bar/conf/nexus.properties',
'match' => '^nexus-webapp-context-path',
'line' => 'nexus-webapp-context-path=/baz',
) }

it { should contain_file_line('nexus-work').with(
'path' => '/foo//bar/conf/nexus.properties',
'match' => '^nexus-work',
'line' => 'nexus-work=/foom',
) }
end
end

# vim: sw=2 ts=2 sts=2 et :

0 comments on commit 2da78c0

Please sign in to comment.