Sha256: 50cc6f62fd9737fa4121782b030ae76c369830ca5cdd68aa0a42e6ff7d0765e6

Contents?: true

Size: 266 Bytes

Versions: 3

Compression:

Stored size: 266 Bytes

Contents

require "ostruct"

describe "OpenStruct#marshal_load when passed [Hash]" do
  it "defines methods based on the passed Hash" do
    os = OpenStruct.new
    os.marshal_load(:age => 20, :name => "John")

    os.age.should eql(20)
    os.name.should == "John"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubysl-ostruct-2.1.0 spec/marshal_load_spec.rb
rubysl-ostruct-2.0.4 spec/marshal_load_spec.rb
rubysl-ostruct-1.0.0 spec/marshal_load_spec.rb