Skip to content

Commit

Permalink
Merge pull request #389 from jplindquist/sekretz
Browse files Browse the repository at this point in the history
Fix broken unit tests
bastelfreak authored Jan 31, 2019

Verified

This commit was signed with the committer’s verified signature.
MilesCranmer Miles Cranmer
2 parents 1cc48f1 + 7bf2b12 commit e6f5fb1
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
@@ -39,7 +39,9 @@
end

context 'set global_config_entry secret', if: fact('os.family') == 'RedHat' do
let (:pp) { "class { 'nodejs': }; nodejs::npm::global_config_entry { '//path.to.registry/:_secret': ensure => present, value => 'cGFzc3dvcmQ=', require => Package[nodejs],}" }
let :pp do
"class { 'nodejs': }; nodejs::npm::global_config_entry { '//path.to.registry/:_secret': ensure => present, value => 'cGFzc3dvcmQ=', require => Package[nodejs],}"
end

it_behaves_like 'an idempotent resource'

@@ -48,8 +50,8 @@
end

describe 'npm config' do
it ('contains the global_config_entry secret') do
npm_output = shell("cat $(/usr/bin/npm config get globalconfig)")
it 'contains the global_config_entry secret' do
npm_output = shell('cat $(/usr/bin/npm config get globalconfig)')
expect(npm_output.stdout).to match '//path.to.registry/:_secret="cGFzc3dvcmQ="'
end
end
2 changes: 1 addition & 1 deletion spec/defines/global_config_entry_spec.rb
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@
end

it 'npm config set :_secret should be executed' do
is_expected.to contain_exec('npm_config present :_secret').with('command' => '/usr/bin/npm config set //path.to.registry/:_secret cGFzc3dvcmQ= --global')
is_expected.to contain_exec('npm_config present //path.to.registry/:_secret').with('command' => '/usr/bin/npm config set //path.to.registry/:_secret cGFzc3dvcmQ= --global')
end
end
end

0 comments on commit e6f5fb1

Please sign in to comment.