Class: Sinclair::Matchers::ChangeClassMethodOn Private
- Inherits:
-
ChangeMethodOn
- Object
- RSpec::Matchers::BuiltIn::BaseMatcher
- Base
- ChangeMethodOn
- Sinclair::Matchers::ChangeClassMethodOn
- Defined in:
- lib/sinclair/matchers/change_class_method_on.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Checks if a class method was changed by the call of a block
This is used with a RSpec DSL method
change_class_method(method_name).on(class_object)
Instance Method Summary collapse
-
#description ⇒ String
private
Return expectaton description.
-
#failure_message_for_should ⇒ String
private
Returns message on expectation failure.
-
#failure_message_for_should_not ⇒ String
private
Returns message on expectation failure for negative expectation.
-
#initialize(target, method_name) ⇒ ChangeClassMethodOn
constructor
private
A new instance of ChangeClassMethodOn.
Methods included from MethodTo
#failure_message, #failure_message_when_negated, #matches?
Methods inherited from Base
#equal?, #supports_block_expectations?
Constructor Details
#initialize(target, method_name) ⇒ ChangeClassMethodOn
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ChangeClassMethodOn.
18 19 20 21 |
# File 'lib/sinclair/matchers/change_class_method_on.rb', line 18 def initialize(target, method_name) @klass = target super(method_name) end |
Instance Method Details
#description ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return expectaton description
26 27 28 |
# File 'lib/sinclair/matchers/change_class_method_on.rb', line 26 def description "change class method '#{method_name}' on #{klass}" end |
#failure_message_for_should ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns message on expectation failure
33 34 35 36 |
# File 'lib/sinclair/matchers/change_class_method_on.rb', line 33 def "expected class method '#{method_name}' to be changed on #{klass} but " \ "#{initial_state ? "it didn't" : "it didn't exist"}" end |
#failure_message_for_should_not ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns message on expectation failure for negative expectation
41 42 43 |
# File 'lib/sinclair/matchers/change_class_method_on.rb', line 41 def "expected class method '#{method_name}' not to be changed on #{klass} but it was" end |