Class: RSpec::RubyContentMatchers::HaveMethod
- Inherits:
-
RSpec::RubyContentMatcher
- Object
- RSpec::RubyContentMatcher
- RSpec::RubyContentMatchers::HaveMethod
- Defined in:
- lib/code_spec/matchers/have_method.rb
Constant Summary
Constants inherited from RSpec::RubyContentMatcher
RSpec::RubyContentMatcher::ANY_GROUP, RSpec::RubyContentMatcher::LPAR, RSpec::RubyContentMatcher::OPT_ARGS, RSpec::RubyContentMatcher::OPT_SPACES, RSpec::RubyContentMatcher::Q_ANY_GROUP, RSpec::RubyContentMatcher::RPAR, RSpec::RubyContentMatcher::SPACES
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from RSpec::RubyContentMatcher
#content, #content_matches, #end_option
Instance Method Summary collapse
- #failure_message ⇒ Object
- #index ⇒ Object
-
#initialize(method, type = nil, options = {}) ⇒ HaveMethod
constructor
A new instance of HaveMethod.
- #negative_failure_message ⇒ Object
Methods inherited from RSpec::RubyContentMatcher
#any_args_expr, #args_msg, #comment_end, #debug, #debug?, #debug_content, #display, #display_content, #end_expr, #get_expr, #handle_result, #indexes, #is_match?, #matches?, #opt
Constructor Details
#initialize(method, type = nil, options = {}) ⇒ HaveMethod
Returns a new instance of HaveMethod.
12 13 14 15 16 17 |
# File 'lib/code_spec/matchers/have_method.rb', line 12 def initialize(method, type=nil, = {}) @method = method.to_s super method @type = type @args = [:args] end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
10 11 12 |
# File 'lib/code_spec/matchers/have_method.rb', line 10 def args @args end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
10 11 12 |
# File 'lib/code_spec/matchers/have_method.rb', line 10 def method @method end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
10 11 12 |
# File 'lib/code_spec/matchers/have_method.rb', line 10 def type @type end |
Instance Method Details
#failure_message ⇒ Object
23 24 25 26 |
# File 'lib/code_spec/matchers/have_method.rb', line 23 def super display "Expected there to be the #{class_msg} method #{method}, but there wasn't" end |
#index ⇒ Object
19 20 21 |
# File 'lib/code_spec/matchers/have_method.rb', line 19 def index 1 end |
#negative_failure_message ⇒ Object
28 29 30 31 |
# File 'lib/code_spec/matchers/have_method.rb', line 28 def super display "Did not expect there to be the #{class_msg} method #{method}, but there was" end |