Sha256: 6ed56ce4ba34cabc2cffa2dabd7e0ba3a72510bd1969c1e62387ca40cc091e5f

Contents?: true

Size: 770 Bytes

Versions: 2

Compression:

Stored size: 770 Bytes

Contents

require 'spec_helper'

describe Celluloid, "extensions" do
  before do
    class WillKane
      include Celluloid

      def speak
        "Don't shove me Harv."
      end
    end
    @marshal = WillKane.new
  end

  it "marshals Celluloid::CellProxy objects" do
    string = Marshal.dump(@marshal)
    Marshal.load(string).should be_alive
  end

  it "marshals Celluloid::Mailbox objects" do
    @marshal.mailbox.should be_a(Celluloid::Mailbox)
    string = Marshal.dump(@marshal.mailbox)
    Marshal.load(string).should be_alive
  end

  it "marshals Celluloid::Future objects" do
    future = @marshal.future(:speak)
    future.should be_a(Celluloid::Future)
    string = Marshal.dump(future)
    Marshal.load(string).value.should == "Don't shove me Harv."
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
dcell-0.16.1 spec/dcell/celluloid_ext_spec.rb
stn-dcell-0.16.0 spec/dcell/celluloid_ext_spec.rb