Exception: RSpec::Puppet::Errors::MatchError
- Inherits:
-
StandardError
- Object
- StandardError
- RSpec::Puppet::Errors::MatchError
- Defined in:
- lib/rspec-puppet/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#actual ⇒ Object
readonly
Returns the value of attribute actual.
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#negative ⇒ Object
readonly
Returns the value of attribute negative.
-
#param ⇒ Object
readonly
Returns the value of attribute param.
Instance Method Summary collapse
-
#initialize(param, expected, actual, negative) ⇒ MatchError
constructor
A new instance of MatchError.
- #message ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(param, expected, actual, negative) ⇒ MatchError
Returns a new instance of MatchError.
6 7 8 9 10 11 |
# File 'lib/rspec-puppet/errors.rb', line 6 def initialize(param, expected, actual, negative) @param = param @expected = expected @actual = actual @negative = negative end |
Instance Attribute Details
#actual ⇒ Object (readonly)
Returns the value of attribute actual.
4 5 6 |
# File 'lib/rspec-puppet/errors.rb', line 4 def actual @actual end |
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
4 5 6 |
# File 'lib/rspec-puppet/errors.rb', line 4 def expected @expected end |
#negative ⇒ Object (readonly)
Returns the value of attribute negative.
4 5 6 |
# File 'lib/rspec-puppet/errors.rb', line 4 def negative @negative end |
#param ⇒ Object (readonly)
Returns the value of attribute param.
4 5 6 |
# File 'lib/rspec-puppet/errors.rb', line 4 def param @param end |
Instance Method Details
#message ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rspec-puppet/errors.rb', line 13 def if @param.to_s == 'content' and expected.is_a?( String ) if negative == true "#{param} not set to supplied string" else "#{param} set to supplied string" end else if negative == true "#{param} not set to #{expected.inspect} but it is set to #{actual.inspect}" else "#{param} set to #{expected.inspect} but it is set to #{actual.inspect}" end end end |
#to_s ⇒ Object
29 30 31 |
# File 'lib/rspec-puppet/errors.rb', line 29 def to_s end |