Class: Warp::ControllerMatchers::AssignWithMatcher
- Inherits:
-
AssignMatcher
- Object
- Matcher
- AssignMatcher
- Warp::ControllerMatchers::AssignWithMatcher
- Defined in:
- lib/warp/controller_matchers/assign_matcher.rb
Instance Attribute Summary collapse
-
#assign_with ⇒ Object
readonly
Returns the value of attribute assign_with.
Attributes inherited from AssignMatcher
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(controller, assign_key, assign_with) ⇒ AssignWithMatcher
constructor
A new instance of AssignWithMatcher.
Methods inherited from AssignMatcher
Constructor Details
#initialize(controller, assign_key, assign_with) ⇒ AssignWithMatcher
Returns a new instance of AssignWithMatcher.
82 83 84 85 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 82 def initialize(controller, assign_key, assign_with) super(controller, assign_key) @assign_with = assign_with end |
Instance Attribute Details
#assign_with ⇒ Object (readonly)
Returns the value of attribute assign_with.
80 81 82 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 80 def assign_with @assign_with end |
Instance Method Details
#description ⇒ Object
87 88 89 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 87 def description "assign @#{assign_key} with #{description_of(assign_with)}" end |
#failure_message ⇒ Object
91 92 93 94 95 96 97 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 91 def if assign_value.nil? "expected @#{assign_key} to be assigned with #{description_of(assign_with)} but was not assigned" else "expected @#{assign_key} to be assigned with #{description_of(assign_with)} but was assigned with #{assign_value.inspect}" end end |
#failure_message_when_negated ⇒ Object
99 100 101 |
# File 'lib/warp/controller_matchers/assign_matcher.rb', line 99 def "expected @#{assign_key} to not be assigned with #{description_of(assign_with)}" end |