Class: Warp::ControllerMatchers::AssignWithAMatcher
- Inherits:
-
AssignMatcher
- Object
- Matcher
- AssignMatcher
- Warp::ControllerMatchers::AssignWithAMatcher
- Defined in:
- lib/warp/controller_matchers/assign_matcher.rb
Instance Attribute Summary collapse
-
#assign_with_a ⇒ Object
readonly
Returns the value of attribute assign_with_a.
Attributes inherited from AssignMatcher
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(controller, assign_key, assign_with_a) ⇒ AssignWithAMatcher
constructor
A new instance of AssignWithAMatcher.
Methods inherited from AssignMatcher
Constructor Details
#initialize(controller, assign_key, assign_with_a) ⇒ AssignWithAMatcher
Returns a new instance of AssignWithAMatcher.
113 114 115 116 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 113 def initialize(controller, assign_key, assign_with_a) super(controller, assign_key) @assign_with_a = assign_with_a end |
Instance Attribute Details
#assign_with_a ⇒ Object (readonly)
Returns the value of attribute assign_with_a.
111 112 113 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 111 def assign_with_a @assign_with_a end |
Instance Method Details
#description ⇒ Object
118 119 120 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 118 def description "assign @#{assign_key} with an instance of #{assign_with_a.name}" end |
#failure_message ⇒ Object
122 123 124 125 126 127 128 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 122 def if assign_value.nil? "expected @#{assign_key} to be assigned with an instance of #{assign_with_a.name} but was not assigned" else "expected @#{assign_key} to be assigned with an instance of #{assign_with_a.name} but was assigned with an instance of #{assign_value.class.name}" end end |
#failure_message_when_negated ⇒ Object
130 131 132 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 130 def "expected @#{assign_key} to not be assigned with an instance of #{assign_with_a.name}" end |