Module: Expected::Matchers
- Defined in:
- lib/expected/matchers.rb,
lib/expected/matchers/be_a_concern.rb,
lib/expected/matchers/inherit_from.rb,
lib/expected/matchers/extend_module.rb,
lib/expected/matchers/have_constant.rb,
lib/expected/matchers/include_module.rb,
lib/expected/matchers/have_attr_reader.rb,
lib/expected/matchers/have_attr_writer.rb,
lib/expected/matchers/have_attr_accessor.rb
Overview
:nodoc:
Defined Under Namespace
Classes: BeAConcernMatcher, ExtendModuleMatcher, HaveAttrAccessorMatcher, HaveAttrReaderMatcher, HaveAttrWriterMatcher, HaveConstantMatcher, IncludeModuleMatcher, InheritFromMatcher
Instance Method Summary collapse
-
#be_a_concern ⇒ BeAConcernMatcher
Used to test inheritance.
-
#extend_module(expected_module) ⇒ ExtendModuleMatcher
Used to test inheritance.
-
#have_attr_accessor(attribute) ⇒ HaveAttrAccessorMatcher
Used to test inclusion of ‘attr_accessor :attribute` on the subject.
-
#have_attr_reader(attribute) ⇒ HaveAttrReaderMatcher
Used to test inclusion of ‘attr_reader :attribute` on the subject.
-
#have_attr_writer(attribute) ⇒ HaveAttrWriterMatcher
Used to test inclusion of ‘attr_writer :attribute` on the subject.
-
#have_constant(name) ⇒ HaveConstantMatcher
Used to test constants.
-
#include_module(expected_module) ⇒ IncludeModuleMatcher
Used to test inheritance.
-
#inherit_from(expected_ancestor) ⇒ InheritFromMatcher
Used to test inheritance.
Instance Method Details
#be_a_concern ⇒ BeAConcernMatcher
Used to test inheritance
15 16 17 |
# File 'lib/expected/matchers/be_a_concern.rb', line 15 def be_a_concern BeAConcernMatcher.new end |
#extend_module(expected_module) ⇒ ExtendModuleMatcher
Used to test inheritance
14 15 16 |
# File 'lib/expected/matchers/extend_module.rb', line 14 def extend_module(expected_module) ExtendModuleMatcher.new(expected_module) end |
#have_attr_accessor(attribute) ⇒ HaveAttrAccessorMatcher
Used to test inclusion of ‘attr_accessor :attribute` on the subject
18 19 20 |
# File 'lib/expected/matchers/have_attr_accessor.rb', line 18 def have_attr_accessor(attribute) # rubocop:disable Naming/PredicateName HaveAttrAccessorMatcher.new(attribute) end |
#have_attr_reader(attribute) ⇒ HaveAttrReaderMatcher
Used to test inclusion of ‘attr_reader :attribute` on the subject
16 17 18 |
# File 'lib/expected/matchers/have_attr_reader.rb', line 16 def have_attr_reader(attribute) # rubocop:disable Naming/PredicateName HaveAttrReaderMatcher.new(attribute) end |
#have_attr_writer(attribute) ⇒ HaveAttrWriterMatcher
Used to test inclusion of ‘attr_writer :attribute` on the subject
16 17 18 |
# File 'lib/expected/matchers/have_attr_writer.rb', line 16 def have_attr_writer(attribute) # rubocop:disable Naming/PredicateName HaveAttrWriterMatcher.new(attribute) end |
#have_constant(name) ⇒ HaveConstantMatcher
Used to test constants
20 21 22 |
# File 'lib/expected/matchers/have_constant.rb', line 20 def have_constant(name) # rubocop:disable Naming/PredicateName HaveConstantMatcher.new(name) end |
#include_module(expected_module) ⇒ IncludeModuleMatcher
Used to test inheritance
14 15 16 |
# File 'lib/expected/matchers/include_module.rb', line 14 def include_module(expected_module) IncludeModuleMatcher.new(expected_module) end |
#inherit_from(expected_ancestor) ⇒ InheritFromMatcher
Used to test inheritance
14 15 16 |
# File 'lib/expected/matchers/inherit_from.rb', line 14 def inherit_from(expected_ancestor) InheritFromMatcher.new(expected_ancestor) end |