summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHelen Campbell <helen@puppetlabs.com>2016-11-24 16:32:15 +0000
committerHelen Campbell <helen@puppetlabs.com>2016-11-29 13:48:33 +0000
commite501cb1b646e9741fb6f2510a1a3a434041a4d33 (patch)
treeb1efa1112aa2a6421f165e9a706cee64f9a2d3bc /spec
parent746c1f83984ce875d810e00788e383109fa7ab2f (diff)
Update deprecation tests to include future parser
Diffstat (limited to 'spec')
-rw-r--r--spec/acceptance/deprecation_spec.rb17
-rw-r--r--spec/functions/deprecation_spec.rb5
2 files changed, 21 insertions, 1 deletions
diff --git a/spec/acceptance/deprecation_spec.rb b/spec/acceptance/deprecation_spec.rb
index ea13700..7a0b34c 100644
--- a/spec/acceptance/deprecation_spec.rb
+++ b/spec/acceptance/deprecation_spec.rb
@@ -82,4 +82,21 @@ describe 'deprecation function' do
it { is_expected.to be_file }
end
end
+
+ context 'puppet 3 test', if: get_puppet_version =~ /^3/ do
+ before :all do
+ @result = on(default, puppet('apply', '--parser=future', '-e', add_file_manifest), acceptable_exit_codes: (0...256))
+ end
+ after :all do
+ apply_manifest(remove_file_manifest)
+ end
+
+ it "should return a deprecation error" do
+ expect(@result.stderr).to match(/Warning: message/)
+ end
+ it "should pass without error" do
+ expect(@result.exit_code).to eq(0)
+ end
+ end
+
end
diff --git a/spec/functions/deprecation_spec.rb b/spec/functions/deprecation_spec.rb
index 9859833..cee4f1c 100644
--- a/spec/functions/deprecation_spec.rb
+++ b/spec/functions/deprecation_spec.rb
@@ -41,11 +41,14 @@ if Puppet.version.to_f >= 4.0
}
end
else
+ # Puppet version < 4 will use these tests.
describe 'deprecation' do
after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
- ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+ before(:all) do
+ ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+ end
it { is_expected.not_to eq(nil) }
it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }