File tree 2 files changed +23
-0
lines changed
lib/puppet/provider/mysql_login_path
spec/unit/puppet/provider/mysql_login_path
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -6,4 +6,9 @@ class Puppet::Provider::MysqlLoginPath::Sensitive < Puppet::Pops::Types::PSensit
6
6
def ==( other )
7
7
return true if other . is_a? ( Puppet ::Pops ::Types ::PSensitiveType ::Sensitive ) && unwrap == other . unwrap
8
8
end
9
+
10
+ def encode_with ( coder )
11
+ coder . tag = nil
12
+ coder . scalar = 'Puppet::Provider::MysqlLoginPath::Sensitive <<encrypted>>'
13
+ end
9
14
end
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ ensure_module_defined ( 'Puppet::Provider::MysqlLoginPath' )
6
+ require 'puppet/provider/mysql_login_path/sensitive'
7
+ require 'psych'
8
+
9
+ RSpec . describe Puppet ::Provider ::MysqlLoginPath ::Sensitive do
10
+ subject ( :sensitive ) { described_class . new ( 'secret' ) }
11
+
12
+ describe 'Puppet::Provider::MysqlLoginPath::Sensitive' do
13
+ it 'encodes its value correctly into transactionstore.yaml' do
14
+ psych_encoded = Psych . load ( Psych . dump ( sensitive ) )
15
+ expect ( psych_encoded ) . to eq 'Puppet::Provider::MysqlLoginPath::Sensitive <<encrypted>>'
16
+ end
17
+ end
18
+ end
You can’t perform that action at this time.
0 commit comments