Skip to content

Commit 75e59d3

Browse files
author
Helen Campbell
committed
Update deprecation tests to include future parser
1 parent 746c1f8 commit 75e59d3

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

spec/acceptance/deprecation_spec.rb

+14
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,18 @@
8282
it { is_expected.to be_file }
8383
end
8484
end
85+
86+
context 'puppet 3 test', if: get_puppet_version =~ /^3/ do
87+
before :all do
88+
@result = on(default, puppet('apply', '--parser=future', '-e', add_file_manifest), acceptable_exit_codes: (0...256))
89+
end
90+
after :all do
91+
apply_manifest(remove_file_manifest)
92+
end
93+
94+
it "should not return an error" do
95+
expect(@result.stderr).to match(/Warning: message/)
96+
end
97+
end
98+
8599
end

spec/functions/deprecation_spec.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@
4141
}
4242
end
4343
else
44+
# Puppet version < 4 will use these tests.
4445
describe 'deprecation' do
4546
after(:all) do
4647
ENV.delete('STDLIB_LOG_DEPRECATIONS')
4748
end
48-
ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
49+
before(:all) do
50+
ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
51+
end
4952
it { is_expected.not_to eq(nil) }
5053
it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
5154

0 commit comments

Comments
 (0)