Sha256: b41a208e05c6cf7531bc925766cdfa8bc3126eb333191eb244af97578014013f

Contents?: true

Size: 651 Bytes

Versions: 1

Compression:

Stored size: 651 Bytes

Contents

describe "Attributes#set_path" do
  
  it "should call regular set_path when no dot used in path" do
    a = KVCPathTestA.new
    b = KVCPathTestB.new
    a.set_path 'part_b', b
    a.part_b.should == b
  end
  
  it "should split the path for dot seperated keys, using the last part to set the key" do
    a = KVCPathTestA.new
    b = KVCPathTestB.new
    c = KVCPathTestC.new
    
    a.set_path 'part_b', b
    a.set_path 'part_b.part_c', c
    a.set_path 'part_b.part_c.first_name', "adam"
    
    a.get_path('part_b').should == b
    a.get_path('part_b.part_c').should == c
    a.get_path('part_b.part_c.first_name').should == "adam"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opal-0.1.0 opals/foundation/spec/system/attributes/set_path_spec.rb