Skip to content

Commit

Permalink
correct params in spec
Browse files Browse the repository at this point in the history
  • Loading branch information
avbm committed Feb 26, 2020
1 parent 8d68dd2 commit 88f5c74
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions spec/classes/jenkins_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
it { is_expected.to contain_exec('reload-jenkins').with_command(%r{http://localhost:9000}) }
it { is_expected.to contain_exec('reload-jenkins').with_command(%r{-i\s'/path/to/key'}) }
it { is_expected.to contain_exec('reload-jenkins').that_requires('File[/path/to/libdir/jenkins-cli.jar]') }
it { is_expected.to contain_exec('safe-restart-jenkins') }
it { is_expected.to contain_exec('safe-restart-jenkins').with('cmd_environment' => nil) }
it { is_expected.to contain_jenkins__sysconfig('HTTP_PORT').with_value('9000') }

describe 'jenkins::cli' do
Expand All @@ -42,20 +42,24 @@
end

context '$cli_password is defined' do
let(:params) {
let(:params) do
{
'cli_username' => 'user01',
'cli_password' => 'password01',
version: '2.54',
libdir: '/path/to/libdir',
cli: true,
cli_remoting_free: true,
cli_username: 'user01',
cli_password: 'password01'
}
}
end

it do
is_expected.to contain_exec('safe-restart-jenkins').with({
is_expected.to contain_exec('safe-restart-jenkins').with(
'cmd_environment' => [
"JENKINS_USER_ID=user01",
"JENKINS_API_TOKEN=password01",
],
})
'JENKINS_USER_ID=user01',
'JENKINS_API_TOKEN=password01'
]
)
end
end
end
Expand Down

0 comments on commit 88f5c74

Please sign in to comment.