diff --git a/Gemfile b/Gemfile index de19ac94..84a86e1a 100644 --- a/Gemfile +++ b/Gemfile @@ -11,7 +11,7 @@ group :tests do gem 'simplecov-console' # the test gems required for module testing - gem 'puppetlabs_spec_helper', '~> 2.7' + gem 'puppetlabs_spec_helper', '~> 3.0' gem 'rspec-puppet' # since the Resource API runs inside the puppetserver, test against the JRuby versions we ship diff --git a/spec/acceptance/sensitive_spec.rb b/spec/acceptance/sensitive_spec.rb index e23c4088..6125df4c 100644 --- a/spec/acceptance/sensitive_spec.rb +++ b/spec/acceptance/sensitive_spec.rb @@ -8,31 +8,31 @@ describe 'using `puppet apply`' do it 'is not exposed by notify' do - stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"notice(Sensitive('foo'))\"") + stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"notice(Sensitive('sesitive_data'))\"") expect(stdout_str).to match %r{redacted} - expect(stdout_str).not_to match %r{foo} + expect(stdout_str).not_to match %r{sesitive_data} expect(stdout_str).not_to match %r{warn|error}i end it 'is not exposed by a provider' do - stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"test_sensitive { bar: secret => Sensitive('foo'), "\ - "optional_secret => Sensitive('optional foo'), array_secret => [Sensitive('array foo')] }\"") + stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"test_sensitive { test_resource: secret => Sensitive('sesitive_data'), "\ + "optional_secret => Sensitive('optional sesitive_data'), array_secret => [Sensitive('array sesitive_data')] }\"") expect(stdout_str).to match %r{redacted} - expect(stdout_str).not_to match %r{foo} + expect(stdout_str).not_to match %r{sesitive_data} expect(stdout_str).not_to match %r{warn|error}i end context 'when a sensitive value is not the top level type' do it 'is not exposed by a provider' do - stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"test_sensitive { bar: secret => Sensitive('foo'), "\ - "optional_secret => Sensitive('optional foo'), variant_secret => [Sensitive('variant foo')] }\"") + stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"test_sensitive { test_resource: secret => Sensitive('sesitive_data'), "\ + "optional_secret => Sensitive('optional sesitive_data'), variant_secret => [Sensitive('variant sesitive_data')] }\"") expect(stdout_str).to match %r{redacted} - expect(stdout_str).not_to match %r{variant foo} + expect(stdout_str).not_to match %r{variant sesitive_data} expect(stdout_str).not_to match %r{warn|error}i end it 'properly validates the sensitive type value' do - stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"test_sensitive { bar: secret => Sensitive('foo'), "\ - "optional_secret => Sensitive('optional foo'), variant_secret => [Sensitive(134679)] }\"") + stdout_str, _status = Open3.capture2e("puppet apply #{common_args} -e \"test_sensitive { test_resource: secret => Sensitive('sesitive_data'), "\ + "optional_secret => Sensitive('optional sesitive_data'), variant_secret => [Sensitive(134679)] }\"") expect(stdout_str).to match %r{Sensitive\[String\]( value)?, got Sensitive\[Integer\]} expect(stdout_str).not_to match %r{134679} end @@ -43,7 +43,7 @@ it 'is not exposed in the output' do stdout_str, _status = Open3.capture2e("puppet resource #{common_args} test_sensitive") expect(stdout_str).to match %r{redacted} - expect(stdout_str).not_to match %r{(foo|bar)secret} + expect(stdout_str).not_to match %r{(sesitive_data|test_resource)secret} expect(stdout_str).not_to match %r{warn|error}i end end