Skip to content

Commit 4d2eb27

Browse files
committed
(MAINT) Fixups for latest puppet_litmus and net-ssh
1 parent e4c0bbe commit 4d2eb27

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

Gemfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ group :test do
2323
end
2424

2525
group :acceptance do
26-
# Litmus has dependencies which require Ruby 2.5 (Puppet 6) or above.
27-
gem 'puppet_litmus' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.5.0')
26+
if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.5.0')
27+
# Litmus has dependencies which require Ruby 2.5 (Puppet 6) or above.
28+
gem 'puppet_litmus', '~> 0.11', '>= 0.11.1'
29+
gem 'net-ssh', '~> 5.2'
30+
end
2831
end
2932

3033
group :development do

spec/acceptance/emit_json_options_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
{ :title => '--emit-json-stdout', :cmd_line => '--emit-json-stdout' }
5050
].each do |testcase|
5151
it "should emit JSON to stdout when using #{testcase[:title]}" do
52-
output = PuppetLitmus::Serverspec.run_shell("puppet strings generate #{testcase[:cmd_line]} \"#{@test_module_path}/lib/puppet/parser/functions/function3x.rb\"").stdout.chomp
52+
output = PuppetLitmus::PuppetHelpers.run_shell("puppet strings generate #{testcase[:cmd_line]} \"#{@test_module_path}/lib/puppet/parser/functions/function3x.rb\"").stdout.chomp
5353
expect(JSON.parse(output)).to eq(expected)
5454
end
5555
end
@@ -61,7 +61,7 @@
6161
it "should write JSON to a file when using #{testcase[:title]}" do
6262
tmpfile = File.join(@remote_tmp_path, 'json_output.json')
6363
cmd = "puppet strings generate #{testcase[:cmd_line].gsub('TMPFILE', tmpfile)} \"#{@test_module_path}/lib/puppet/parser/functions/function3x.rb\""
64-
PuppetLitmus::Serverspec.run_shell(cmd)
64+
PuppetLitmus::PuppetHelpers.run_shell(cmd)
6565
output = JSON.parse(file(tmpfile).content)
6666
expect(output).to eq(expected)
6767
end

spec/acceptance/generate_markdown_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ class { "test": }
3535

3636
it 'should render Markdown to stdout when using --format markdown' do
3737
skip('This test is broken. Does not output to STDOUT by default.')
38-
output = PuppetLitmus::Serverspec.run_shell("puppet strings generate --format markdown \"#{@test_module_path}/manifests/init.pp\"").stdout.chomp
38+
output = PuppetLitmus::PuppetHelpers.run_shell("puppet strings generate --format markdown \"#{@test_module_path}/manifests/init.pp\"").stdout.chomp
3939
expect(output).to eq(expected)
4040
end
4141

4242
it 'should write Markdown to a file when using --format markdown and --out' do
4343
tmpfile = File.join(@remote_tmp_path, 'md_output.md')
44-
remote = PuppetLitmus::Serverspec.run_shell("puppet strings generate --format markdown --out \"#{tmpfile}\" \"#{@test_module_path}/manifests/init.pp\"")
44+
remote = PuppetLitmus::PuppetHelpers.run_shell("puppet strings generate --format markdown --out \"#{tmpfile}\" \"#{@test_module_path}/manifests/init.pp\"")
4545
expect(file(tmpfile)).to contain expected
4646
end
4747
end

spec/acceptance/running_strings_generate_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
describe 'Generating module documentation using generate action' do
55
before :all do
66
# TODO: Linux only
7-
@sut_work_dir = PuppetLitmus::Serverspec.run_shell("pwd").stdout.chomp
7+
@sut_work_dir = PuppetLitmus::PuppetHelpers.run_shell("pwd").stdout.chomp
88

99
test_module_path = sut_module_path(/Module test/)
10-
PuppetLitmus::Serverspec.run_shell("puppet strings generate \"#{test_module_path}/**/*.{rb,pp}\"")
10+
PuppetLitmus::PuppetHelpers.run_shell("puppet strings generate \"#{test_module_path}/**/*.{rb,pp}\"")
1111
end
1212

1313
def expect_file_contain(path, expected_contents)

spec/spec_helper_acceptance_local.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
def sut_module_path(module_regex)
2-
modules = JSON.parse(PuppetLitmus::Serverspec.run_shell('puppet module list --render-as json').stdout)
2+
modules = JSON.parse(PuppetLitmus::PuppetHelpers.run_shell('puppet module list --render-as json').stdout)
33
test_module_info = modules['modules_by_path'].values.flatten.find { |mod_info| mod_info =~ module_regex }
44
test_module_info.match(/\(([^)]*)\)/)[1]
55
end

0 commit comments

Comments
 (0)