Class: ConvenientService::RSpec::PrimitiveMatchers::Classes::ExtendModule
- Inherits:
-
Object
- Object
- ConvenientService::RSpec::PrimitiveMatchers::Classes::ExtendModule
- Defined in:
- lib/convenient_service/rspec/primitive_matchers/classes/extend_module.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(mod) ⇒ ExtendModule
constructor
NOTE:
mod
sincemodule
is a keyword. - #matches?(klass) ⇒ Boolean
Constructor Details
#initialize(mod) ⇒ ExtendModule
NOTE: mod
since module
is a keyword.
11 12 13 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/extend_module.rb', line 11 def initialize(mod) @mod = mod end |
Instance Method Details
#description ⇒ Object
21 22 23 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/extend_module.rb', line 21 def description "extend module `#{mod}`" end |
#failure_message ⇒ Object
25 26 27 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/extend_module.rb', line 25 def "expected `#{klass}` to extend module `#{mod}`" end |
#failure_message_when_negated ⇒ Object
29 30 31 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/extend_module.rb', line 29 def "expected `#{klass}` NOT to extend module `#{mod}`" end |
#matches?(klass) ⇒ Boolean
15 16 17 18 19 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/extend_module.rb', line 15 def matches?(klass) @klass = klass klass.singleton_class.included_modules.include?(mod) end |