Sha256: 1fe9062911ff7d42b21455f4f79d705d22a51a29b4db951db7047beb70de1d55

Contents?: true

Size: 617 Bytes

Versions: 1

Compression:

Stored size: 617 Bytes

Contents

describe DataMapper::EmbeddedValue do
    
  before(:all) do
    @bob = Person[:name => 'Bob']
  end
  
  it 'should proxy getting values for you' do
    @bob.address.street.should == '123 Happy Ln.'
  end
  
  it 'should return a sub-class of the containing class' do
    @bob.address.class.should be(Person::Address)
  end
  
  it 'should allow definition of instance methods' do
    @bob.address.city_state_zip_code.should == 'Dallas, TX 75000'
  end
  
  it 'should allow you to use your own classes as well as long as they inherit from EmbeddedValue' do
    @bob.location.to_s.should == 'Dallas, TX'
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
datamapper-0.2.0 spec/embedded_value_spec.rb