Hi,

I cloned a ripple object and change the state of it. Unfortunately it
also change to state of the original object. How is this possible? Am
I doing something wrong? Here is the spec to show the example:

class Person
  include Ripple::Document

  property :name, String
end

class Dude
  attr_accessor :name
end

describe 'test' do
  it "should copy object" do
    joe = Person.new
    joe.name = 'Joe'

    john = joe.clone
    john.name = 'John'

    joe.name.should == 'Joe'
    john.name.should == 'John'

    joe = Dude.new
    joe.name = 'Joe'

    john = joe.clone
    john.name = 'John'

    joe.name.should == 'Joe'
    john.name.should == 'John'

  end
end

The spec will fail when asserting Joe's (Person) name. Please advise
on how I can resolve this problem.

Thank you for your assistance.

Kind regards,
Joshua.

-- 
http://twitter.com/jpartogi

_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to