Sha256: 5f6241176210a5abc8624785d5f5adbae576b3360bb5e3e04a64f49933d40bcd

Contents?: true

Size: 559 Bytes

Versions: 3

Compression:

Stored size: 559 Bytes

Contents

require 'delegate'

describe "SimpleDelegator" do
  before :all do
    @obj = "hello"
    @delegate = SimpleDelegator.new(@obj)
  end

  it "can be marshalled" do
    m = Marshal.load(Marshal.dump(@delegate))
    m.class.should == SimpleDelegator
    (m == @obj).should be_true
  end

  ruby_bug "redmine:1744", "1.8.7" do
    it "can be marshalled with its instance variables intact" do
      @delegate.instance_variable_set(:@foo, "bar")
      m = Marshal.load(Marshal.dump(@delegate))
      m.instance_variable_get(:@foo).should == "bar"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubysl-delegate-2.0.1 spec/delegator/marshal_spec.rb
rubysl-delegate-1.0.0 spec/delegator/marshal_spec.rb
rubysl-delegate-2.0.0 spec/delegator/marshal_spec.rb