Sha256: 7f79d3f1dd32cd16fc7a7c77a78416fa3d7f76003d96ccc0b75c0131c8e4158e

Contents?: true

Size: 518 Bytes

Versions: 1

Compression:

Stored size: 518 Bytes

Contents

# Tests that a value can be set with a parameters hash, and that an accessor is set on that field.
# Meaning: MyClass.new(:some_accessor => :some_value).some_accessor # => :some_value
# and obj = MyClass.new(:key => :value); obj.key = :new_value; obj.key # => :new_value
RSpec::Matchers.define :have_an_initialization_accessor_for do |attr|
  match do |klass|
    obj = klass.new(attr => :value)
    obj.send(attr).should eql(:value)
    obj.send("#{attr}=", :value2)
    obj.send(attr).should eql(:value2)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fathom-0.5.0 spec/support/custom_matchers.rb