Sha256: c673edc22fb994036f36a57962052118dfa59774d5a895d435393ae8ad38b003

Contents?: true

Size: 656 Bytes

Versions: 62

Compression:

Stored size: 656 Bytes

Contents

require "spec_helper"

describe SC::HashStruct, 'hash operations' do

  include SC::SpecHelpers

  it "should allow arbitrary keys to be set/read using hash methods" do
    e = SC::HashStruct.new
    e[:foo] = :bar
    e[:foo].should eql(:bar)
  end

  it "should set any hash options passed to new" do
    e = SC::HashStruct.new :foo => :bar
    e[:foo].should eql(:bar)
  end

  it "should read any missing methods from the hash" do
    e = SC::HashStruct.new :foo => :bar
    e.foo.should eql(:bar)
  end

  it "should write missing methods ending in = to the hash" do
    e = SC::HashStruct.new
    e.foo = :bar
    e[:foo].should eql(:bar)
  end

end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
sproutcore-1.11.0 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.11.0.rc3 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.11.0.rc2 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.11.0.rc1 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.10.3.1 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.10.2 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.10.1 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.10.0 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.10.0.rc.3 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.10.0.rc.2 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.10.0.rc.1 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.9.2 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.9.1 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.9.0 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.8.2.1 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.8.1 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.8.0 spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.7.1.beta-java spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.7.1.beta spec/lib/models/hash_struct/hash_spec.rb
sproutcore-1.6.0.1-java spec/lib/models/hash_struct/hash_spec.rb