Class: RSpec::Puppet::Sensitive

Inherits:
Puppet::Pops::Types::PSensitiveType::Sensitive
  • Object
show all
Defined in:
lib/rspec-puppet/sensitive.rb,
lib/rspec-puppet/sensitive.rb

Overview

:nocov:

Instance Method Summary collapse

Constructor Details

#initialize(_value) ⇒ Sensitive

Create a new Sensitive object



9
10
11
# File 'lib/rspec-puppet/sensitive.rb', line 9

def initialize(value)
  @value = value
end

Instance Method Details

#==(other) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/rspec-puppet/sensitive.rb', line 32

def ==(other)
  if other.respond_to? :unwrap
    if unwrap.is_a?(Regexp)
      unwrap =~ other.unwrap
    else
      unwrap == other.unwrap
    end
  else
    super
  end
end

#inspectObject



24
25
26
# File 'lib/rspec-puppet/sensitive.rb', line 24

def inspect
  "Sensitive(#{@value.inspect})"
end

#sensitive?Boolean



19
20
21
# File 'lib/rspec-puppet/sensitive.rb', line 19

def sensitive?
  true
end

#unwrapObject



14
15
16
# File 'lib/rspec-puppet/sensitive.rb', line 14

def unwrap
  @value
end