Class: RSpec::RubyContentMatchers::HaveModule
- Inherits:
-
RSpec::RubyContentMatcher
- Object
- RSpec::RubyContentMatcher
- RSpec::RubyContentMatchers::HaveModule
- Defined in:
- lib/code_spec/matchers/have_class_module.rb
Direct Known Subclasses
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
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#postfix ⇒ Object
readonly
Returns the value of attribute postfix.
-
#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
-
#initialize(name, postfix = nil) ⇒ HaveModule
constructor
A new instance of HaveModule.
- #negative_failure_message ⇒ Object
Methods inherited from RSpec::RubyContentMatcher
#any_args_expr, #args_expr, #args_msg, #comment_end, #debug, #debug?, #debug_content, #display, #display_content, #end_expr, #get_expr, #handle_result, #index, #indexes, #is_match?, #matches?, #opt
Constructor Details
#initialize(name, postfix = nil) ⇒ HaveModule
Returns a new instance of HaveModule.
5 6 7 8 9 10 |
# File 'lib/code_spec/matchers/have_class_module.rb', line 5 def initialize(name, postfix=nil) @name = name.to_s.camelize super @name @postfix = postfix.to_s.camelize if postfix @type = :module end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/code_spec/matchers/have_class_module.rb', line 3 def name @name end |
#postfix ⇒ Object (readonly)
Returns the value of attribute postfix.
3 4 5 |
# File 'lib/code_spec/matchers/have_class_module.rb', line 3 def postfix @postfix end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/code_spec/matchers/have_class_module.rb', line 3 def type @type end |
Instance Method Details
#failure_message ⇒ Object
12 13 14 15 |
# File 'lib/code_spec/matchers/have_class_module.rb', line 12 def super display "Expected there to be the #{type} #{name}" end |
#negative_failure_message ⇒ Object
17 18 19 20 |
# File 'lib/code_spec/matchers/have_class_module.rb', line 17 def super display "Did not expected there to be the #{type} #{name}" end |