Class: RSpec::RubyContentMatchers::InheritFrom
- Inherits:
-
RSpec::RubyContentMatcher
- Object
- RSpec::RubyContentMatcher
- RSpec::RubyContentMatchers::InheritFrom
- Defined in:
- lib/code_spec/matchers/inherit_from.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
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Attributes inherited from RSpec::RubyContentMatcher
#alt_end, #content, #content_matches, #end_option
Instance Method Summary collapse
- #failure_message ⇒ Object
- #index ⇒ Object
-
#initialize(klass) ⇒ InheritFrom
constructor
A new instance of InheritFrom.
- #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, #indexes, #is_match?, #matches?, #opt
Constructor Details
#initialize(klass) ⇒ InheritFrom
Returns a new instance of InheritFrom.
5 6 7 8 |
# File 'lib/code_spec/matchers/inherit_from.rb', line 5 def initialize klass @klass = klass.to_s.camelize super @klass end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
3 4 5 |
# File 'lib/code_spec/matchers/inherit_from.rb', line 3 def klass @klass end |
Instance Method Details
#failure_message ⇒ Object
14 15 16 17 |
# File 'lib/code_spec/matchers/inherit_from.rb', line 14 def super "Expected the class to inherit from #{klass}\ncontent:#{content}" end |
#index ⇒ Object
10 11 12 |
# File 'lib/code_spec/matchers/inherit_from.rb', line 10 def index 1 end |
#negative_failure_message ⇒ Object
19 20 21 22 |
# File 'lib/code_spec/matchers/inherit_from.rb', line 19 def super "Did not expect the class to inherit from #{klass}\ncontent:#{content}" end |