Class: ConvenientService::RSpec::PrimitiveMatchers::Classes::HaveAttrAccessor
- Inherits:
-
Object
- Object
- ConvenientService::RSpec::PrimitiveMatchers::Classes::HaveAttrAccessor
- Defined in:
- lib/convenient_service/rspec/primitive_matchers/classes/have_attr_accessor.rb
Instance Method Summary collapse
- #description ⇒ String
- #failure_message ⇒ String
- #failure_message_when_negated ⇒ String
- #initialize(attr_name) ⇒ void constructor
- #matches?(object) ⇒ Boolean
Constructor Details
#initialize(attr_name) ⇒ void
17 18 19 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/have_attr_accessor.rb', line 17 def initialize(attr_name) @attr_name = attr_name end |
Instance Method Details
#description ⇒ String
40 41 42 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/have_attr_accessor.rb', line 40 def description "have attr accessor `#{attr_name}`" end |
#failure_message ⇒ String
47 48 49 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/have_attr_accessor.rb', line 47 def "expected `#{object.class}` to have attr accessor `#{attr_name}`" end |
#failure_message_when_negated ⇒ String
54 55 56 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/have_attr_accessor.rb', line 54 def "expected `#{object.class}` NOT to have attr accessor `#{attr_name}`" end |
#matches?(object) ⇒ Boolean
28 29 30 31 32 33 34 35 |
# File 'lib/convenient_service/rspec/primitive_matchers/classes/have_attr_accessor.rb', line 28 def matches?(object) @object = object return false unless matches_attr_reader? return false unless matches_attr_writer? true end |