Sha256: cb120fb451fd1e1c95d36d918b2004ffddec5b898de0930f492881e670a62c6e
Contents?: true
Size: 522 Bytes
Versions: 2
Compression:
Stored size: 522 Bytes
Contents
require 'spec/spec_helper' describe "Basic object", "auto hashify" do it "should convert into a hash" do test = Class.new do include Hashify::Auto attr_accessor :prop1 end t = test.new t.prop1 = 'testing' t.to_hash.should == {:prop1 => 'testing'} end it "should convert from a hash" do test = Class.new do include Hashify::Auto attr_accessor :prop1 end t = test.from_hash(:prop1 => 'testing') t.prop1.should == 'testing' end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
hashify-0.0.3 | spec/auto_spec.rb |
hashify-0.0.2 | spec/auto_spec.rb |