Class: Surrogate::RSpec::Handler
- Inherits:
-
Struct
- Object
- Struct
- Surrogate::RSpec::Handler
- Defined in:
- lib/surrogate/rspec/api_method_matchers.rb
Instance Attribute Summary collapse
-
#instance ⇒ Object
Returns the value of attribute instance.
-
#language_type ⇒ Object
Returns the value of attribute language_type.
-
#message_type ⇒ Object
Returns the value of attribute message_type.
-
#subject ⇒ Object
Returns the value of attribute subject.
Instance Method Summary collapse
- #failure_message_for_should ⇒ Object
- #failure_message_for_should_not ⇒ Object
- #inspect_arguments(args) ⇒ Object
- #invocations ⇒ Object
- #match? ⇒ Boolean
- #message_for(message_category, message_type) ⇒ Object
- #times_invoked ⇒ Object
- #times_msg(n) ⇒ Object
Instance Attribute Details
#instance ⇒ Object
Returns the value of attribute instance.
71 72 73 |
# File 'lib/surrogate/rspec/api_method_matchers.rb', line 71 def instance @instance end |
#language_type ⇒ Object
Returns the value of attribute language_type
70 71 72 |
# File 'lib/surrogate/rspec/api_method_matchers.rb', line 70 def language_type @language_type end |
#message_type ⇒ Object
Returns the value of attribute message_type.
71 72 73 |
# File 'lib/surrogate/rspec/api_method_matchers.rb', line 71 def @message_type end |
#subject ⇒ Object
Returns the value of attribute subject
70 71 72 |
# File 'lib/surrogate/rspec/api_method_matchers.rb', line 70 def subject @subject end |
Instance Method Details
#failure_message_for_should ⇒ Object
101 102 103 |
# File 'lib/surrogate/rspec/api_method_matchers.rb', line 101 def :should, end |
#failure_message_for_should_not ⇒ Object
105 106 107 |
# File 'lib/surrogate/rspec/api_method_matchers.rb', line 105 def :should_not, end |
#inspect_arguments(args) ⇒ Object
77 78 79 |
# File 'lib/surrogate/rspec/api_method_matchers.rb', line 77 def inspect_arguments(args) MessagesFor.inspect_arguments args end |
#invocations ⇒ Object
85 86 87 |
# File 'lib/surrogate/rspec/api_method_matchers.rb', line 85 def invocations instance.invocations(subject) end |
#match? ⇒ Boolean
93 94 95 |
# File 'lib/surrogate/rspec/api_method_matchers.rb', line 93 def match? times_invoked > 0 end |
#message_for(message_category, message_type) ⇒ Object
73 74 75 |
# File 'lib/surrogate/rspec/api_method_matchers.rb', line 73 def (, ) MessagesFor.(language_type, , , binding) end |
#times_invoked ⇒ Object
89 90 91 |
# File 'lib/surrogate/rspec/api_method_matchers.rb', line 89 def times_invoked invocations.size end |
#times_msg(n) ⇒ Object
97 98 99 |
# File 'lib/surrogate/rspec/api_method_matchers.rb', line 97 def times_msg(n) "#{n} time#{'s' unless n == 1}" end |