Sha256: 89b7bcbfbfa284be3f721beafcd8c91ff8ccc006fc02462726bfd34287eb867d

Contents?: true

Size: 487 Bytes

Versions: 5

Compression:

Stored size: 487 Bytes

Contents

# frozen_string_literal: true

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

  description do
    "have a reader and writer for ##{field}"
  end

  failure_message do |object|
    "expected #{object.inspect} to respond to `:#{field}` and `:#{field}=`"
  end

  failure_message_when_negated do |object|
    "expected #{object.inspect} not to respond to `:#{field}` or `:#{field}=`"
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
push_kit-apns-1.0.0.pre.beta5 spec/support/have_accessor.rb
push_kit-apns-1.0.0.pre.beta4 spec/support/have_accessor.rb
push_kit-apns-1.0.0.pre.beta3 spec/support/have_accessor.rb
push_kit-apns-1.0.0.pre.beta2 spec/support/have_accessor.rb
push_kit-apns-1.0.0.pre.beta1 spec/support/have_accessor.rb