Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions spec/acceptance/deprecation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
require 'shellwords'

describe 'deprecation function' do
before :each do
FileUtils.rm_rf '/tmp/deprecation'
end

context 'with --strict=error', if: get_puppet_version =~ /^4/ do
before :all do
pp = <<-EOS
deprecation('key', 'message')
file { '/tmp/deprecation': ensure => present }
notify { 'deprecation msg': }
EOS
@result = on(default, puppet('apply', '--strict=error', '-e', Shellwords.shellescape(pp)), acceptable_exit_codes: (0...256))
end
Expand All @@ -23,17 +20,13 @@
it "should show the error message" do
expect(@result.stderr).to match(/deprecation. key. message/)
end

describe file('/tmp/deprecation') do
it { is_expected.not_to exist }
end
end

context 'with --strict=warning', if: get_puppet_version =~ /^4/ do
before :all do
pp = <<-EOS
deprecation('key', 'message')
file { '/tmp/deprecation': ensure => present }
notify { 'deprecation msg': }
EOS
@result = on(default, puppet('apply', '--strict=warning', '-e', Shellwords.shellescape(pp)), acceptable_exit_codes: (0...256))
end
Expand All @@ -45,17 +38,13 @@
it "should show the error message" do
expect(@result.stderr).to match(/Warning: message/)
end

describe file('/tmp/deprecation') do
it { is_expected.to exist }
end
end

context 'with --strict=off', if: get_puppet_version =~ /^4/ do
before :all do
pp = <<-EOS
deprecation('key', 'message')
file { '/tmp/deprecation': ensure => present }
notify { 'deprecation msg': }
EOS
@result = on(default, puppet('apply', '--strict=off', '-e', Shellwords.shellescape(pp)), acceptable_exit_codes: (0...256))
end
Expand All @@ -67,9 +56,5 @@
it "should not show the error message" do
expect(@result.stderr).not_to match(/Warning: message/)
end

describe file('/tmp/deprecation') do
it { is_expected.to exist }
end
end
end