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