File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 $nodejs_package_ensure = ' installed'
66 $repo_ensure = ' present'
77 $repo_pin = undef
8- $repo_priority = fact(' os.family' ) == ' Debian' ? ' 990' : ' absent'
8+ $repo_priority = $facts [' os' ][' family' ] == ' Debian' ? {
9+ true => ' 990' ,
10+ default => ' absent' ,
11+ }
912 $repo_proxy = ' absent'
1013 $repo_proxy_password = ' absent'
1114 $repo_proxy_username = ' absent'
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def nodesource_unsupported(nodejs_version)
4242
4343 # Debian 12 contains NodeJS 18, when we test 16 and 18, we need to force the nodesource version
4444 # as Debians versions *can* be newer
45- repo_pin =
45+ repo_priority =
4646 if fact ( 'os.family' ) == 'Debian'
4747 '990'
4848 else
@@ -54,7 +54,7 @@ def nodesource_unsupported(nodejs_version)
5454 <<-PUPPET
5555 class { 'nodejs':
5656 repo_version => '#{ nodejs_version } ',
57- repo_pin => #{ repo_pin } ,
57+ repo_priority => #{ repo_priority } ,
5858 }
5959 PUPPET
6060 end
Original file line number Diff line number Diff line change 8484 end
8585 end
8686
87- context 'and repo_pin set to 10' do
87+ context 'and repo_priority set to 10' do
8888 let :params do
89- default_params . merge! ( repo_pin : '10' )
89+ default_params . merge! ( repo_priority : '10' )
9090 end
9191
92- it 'the repo apt::source resource should contain pin = 10' do
93- is_expected . to contain_apt__source ( 'nodesource' ) . with ( 'pin ' => '10' )
92+ it 'the repo apt::source resource should contain priority = 10' do
93+ is_expected . to contain_apt__pin ( 'nodesource' ) . with ( 'priority ' => '10' )
9494 end
9595 end
9696
97- context 'and repo_pin not set' do
97+ context 'and repo_priority not set' do
9898 let :params do
99- default_params . merge! ( repo_pin : :undef )
99+ default_params . merge! ( repo_priority : :undef )
100100 end
101101
102- it 'the repo apt::source resource should contain pin = undef ' do
103- is_expected . to contain_apt__source ( 'nodesource' ) . with ( 'pin ' => nil )
102+ it 'the repo apt::source resource should contain priority = 990 ' do
103+ is_expected . to contain_apt__pin ( 'nodesource' ) . with ( 'priority ' => 990 )
104104 end
105105 end
106106
109109 default_params . merge! ( repo_version : '9' )
110110 end
111111
112- it 'the repo apt::source resource should contain location = https://deb.nodesource.com/node_9.x' do
113- is_expected . to contain_apt__source ( 'nodesource' ) . with ( 'location' => 'https://deb.nodesource.com/node_9.x' )
112+ it 'the repo apt::source resource should contain location = [ https://deb.nodesource.com/node_9.x] ' do
113+ is_expected . to contain_apt__source ( 'nodesource' ) . with ( 'location' => [ 'https://deb.nodesource.com/node_9.x' ] )
114114 end
115115 end
116116
You can’t perform that action at this time.
0 commit comments