Sha256: e6c6124556c3f60f75ef236fcd8f1143e621f703b2fa040db16348045eb752cc

Contents?: true

Size: 755 Bytes

Versions: 1

Compression:

Stored size: 755 Bytes

Contents

require "spec_helper"

#  WARNING!
#  The following test is valid ONLY if it is run by itself!
#  If a HashModel object has been instantiated before this test
#  the test will not properly verify that the dynamic methods are
#  recreated.

describe HashModel do

  let(:hm_file) {File.expand_path((File.dirname(__FILE__) + '/hashmodel.dat'))}
  let(:hm) {Marshal.load(File.open(hm_file, "r"))}

  context "after deserializing an instance" do
    
    it "remaps dynamic methods if one of them is called" do
      lambda{hm.length}.should_not raise_error
    end
    
  end
  
  context "when a legitimatly non-exisitant method is called" do
    it "should raise an error" do
      lambda{hm.ice_cream}.should raise_error(NoMethodError)
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hashmodel-0.3.1 spec/hash_model/_marshelling_spec.rb