Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Commit

Permalink
fix spec errors in jenkins_cli_helper_spec.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jun 22, 2018
1 parent ab7f8e3 commit f4770a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 32 deletions.
31 changes: 9 additions & 22 deletions manifests/cli_helper.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,28 @@
#
# A helper script for creating resources via the Jenkins cli
#
# Parameters:
#
# ssh_keyfile = undef
# Defaults to the value of $::jenkins::cli_ssh_keyfile. This parameter is
# deprecated, please set $::jenkins::cli_ssh_keyfile instead of setting this
# directly
#
class jenkins::cli_helper (
Optional[Stdlib::Absolutepath] $ssh_keyfile = $::jenkins::cli_ssh_keyfile,
) {
include ::jenkins
include ::jenkins::cli
class jenkins::cli_helper {
include jenkins
include jenkins::cli

Class['jenkins::cli']
-> Class['jenkins::cli_helper']
-> Anchor['jenkins::end']
-> Class['jenkins::cli_helper']
-> Anchor['jenkins::end']

$libdir = $::jenkins::libdir
$cli_jar = $::jenkins::cli::jar
$libdir = $jenkins::libdir
$cli_jar = $jenkins::cli::jar
$port = jenkins_port()
$prefix = jenkins_prefix()
$helper_groovy = "${libdir}/puppet_helper.groovy"

file { $helper_groovy:
source => 'puppet:///modules/jenkins/puppet_helper.groovy',
owner => $::jenkins::user,
group => $::jenkins::group,
owner => $jenkins::user,
group => $jenkins::group,
mode => '0444',
require => Class['jenkins::cli'],
}

if $ssh_keyfile != $::jenkins::cli_ssh_keyfile {
info("Using jenkins::cli_helper(${ssh_keyfile}) is deprecated and will be removed in the next major version of this module")
}

$helper_cmd = join(
delete_undef_values([
'/bin/cat',
Expand Down
10 changes: 0 additions & 10 deletions spec/classes/jenkins_cli_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,4 @@
mode: '0444'
)
end

context 'should accept the ssh_keyfile parameter' do
let(:params) do
{
ssh_keyfile: '/tmp/rspec'
}
end

it { is_expected.to contain_class 'jenkins::cli_helper' }
end
end

0 comments on commit f4770a7

Please sign in to comment.