Class: UrlKeyedObject::RSpec::Matchers::UrlKeyedObjectMatcher
- Inherits:
-
Object
- Object
- UrlKeyedObject::RSpec::Matchers::UrlKeyedObjectMatcher
- Defined in:
- lib/url_keyed_object/rspec/matchers.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
- #matches?(subject) ⇒ Boolean
- #negative_failure_message ⇒ Object
Instance Method Details
#description ⇒ Object
14 15 16 |
# File 'lib/url_keyed_object/rspec/matchers.rb', line 14 def description "have declared has_url_key" end |
#failure_message ⇒ Object
18 19 20 |
# File 'lib/url_keyed_object/rspec/matchers.rb', line 18 def "expected #{@subject.class.name} to have declared has_url_key" end |
#matches?(subject) ⇒ Boolean
9 10 11 12 |
# File 'lib/url_keyed_object/rspec/matchers.rb', line 9 def matches?(subject) @subject = subject @subject.class.respond_to?(:url_key_helper) && @subject.respond_to?(:generate_valid_url_key) end |
#negative_failure_message ⇒ Object
22 23 24 |
# File 'lib/url_keyed_object/rspec/matchers.rb', line 22 def "expected #{@subject.class.name} to have NOT declared has_url_key" end |