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