Class: Remarkable::ActiveRecord::Matchers::HaveClassMethods
- Inherits:
-
Matcher::Base
- Object
- Matcher::Base
- Remarkable::ActiveRecord::Matchers::HaveClassMethods
- Defined in:
- lib/remarkable/active_record/macros/validations/have_class_methods_matcher.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(*methods) ⇒ HaveClassMethods
constructor
A new instance of HaveClassMethods.
- #matches?(subject) ⇒ Boolean
- #negative_failure_message ⇒ Object
Methods inherited from Matcher::Base
Methods included from Matcher::DSL
Constructor Details
#initialize(*methods) ⇒ HaveClassMethods
5 6 7 8 |
# File 'lib/remarkable/active_record/macros/validations/have_class_methods_matcher.rb', line 5 def initialize(*methods) methods. @methods = methods end |
Instance Method Details
#description ⇒ Object
19 20 21 |
# File 'lib/remarkable/active_record/macros/validations/have_class_methods_matcher.rb', line 19 def description "respond to class method #{@methods.to_sentence}" end |
#failure_message ⇒ Object
23 24 25 |
# File 'lib/remarkable/active_record/macros/validations/have_class_methods_matcher.rb', line 23 def "Expected #{expectation} (#{@missing})" end |
#matches?(subject) ⇒ Boolean
10 11 12 13 14 15 16 17 |
# File 'lib/remarkable/active_record/macros/validations/have_class_methods_matcher.rb', line 10 def matches?(subject) @subject = subject assert_matcher_for(@methods) do |method| @method = method have_class_method? end end |
#negative_failure_message ⇒ Object
27 28 29 |
# File 'lib/remarkable/active_record/macros/validations/have_class_methods_matcher.rb', line 27 def "Did not expect #{expectation}" end |