Sha256: 8e77b0cf82a9419b1fa07f474be7694e90dbb0056fa3b3072f21735a9d303a7f
Contents?: true
Size: 953 Bytes
Versions: 17
Compression:
Stored size: 953 Bytes
Contents
# frozen_string_literal: true module ConvenientService module RSpec module Matchers module Custom ## # TODO: Specs. # class HaveAttrAccessor def initialize(attr_name) @attr_name = attr_name end def matches?(object) @object = object Custom::HaveAttrReader.new(attr_name).matches?(object) Custom::HaveAttrWriter.new(attr_name).matches?(object) true end def description "have attr accessor `#{attr_name}`" end def failure_message "expected `#{object.class}` to have attr accessor `#{attr_name}`" end def failure_message_when_negated "expected `#{object.class}` NOT to have attr accessor `#{attr_name}`" end private attr_reader :object, :attr_name end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems