Sha256: fb11555fdc35f29b9215abb1fa8b60fc411a29c51fa63229ccc5a9419eff2a97

Contents?: true

Size: 528 Bytes

Versions: 8

Compression:

Stored size: 528 Bytes

Contents

RSpec::Matchers.define :have_attr_accessor do |field|
  match do |object_instance|
    object_instance.respond_to?(field) &&
      object_instance.respond_to?("#{field}=")
  end

  failure_message do |object_instance|
    "expected attr_accessor for #{field} on #{object_instance}"
  end

  failure_message_when_negated do |object_instance|
    "expected attr_accessor for #{field} not to be defined on #{object_instance}"
  end

  description do
    "checks to see if there is an attr accessor on the supplied object"
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
emites-client-0.1.4 spec/support/matchers/have_attr_accessor.rb
emites-client-0.1.3 spec/support/matchers/have_attr_accessor.rb
emites-client-0.1.2 spec/support/matchers/have_attr_accessor.rb
emites-client-0.1.1 spec/support/matchers/have_attr_accessor.rb
emites-client-0.1.0 spec/support/matchers/have_attr_accessor.rb
emites-client-0.0.4 spec/support/matchers/have_attr_accessor.rb
emites-client-0.0.3 spec/support/matchers/have_attr_accessor.rb
emites-client-0.0.2 spec/support/matchers/have_attr_accessor.rb