Sha256: 50d1276af97c285f5f6d97653fbb4ae6dce4ed11d96ee5e053139015f4829745

Contents?: true

Size: 882 Bytes

Versions: 3

Compression:

Stored size: 882 Bytes

Contents

RSpec.describe Celluloid::Proxy::Abstract do
	around do |ex|
		Celluloid.boot
		ex.run
		Celluloid.shutdown
	end

	let(:task_klass) { Celluloid.task_class }
	let(:actor_class) { ExampleActorClass.create(CelluloidSpecs.included_module, task_klass) }
	let(:actor) { actor_class.new "Troy McClure" }

	let(:logger) { Specs::FakeLogger.current }
	
	it "should be eql? to self" do
		expect(actor.eql? actor).to be_truthy
	end
	
	it "should be eql? to self even if dead" do
		actor.terminate
		expect(actor.eql? actor).to be_truthy
	end
	
	it "should not be eql? to other proxy objects" do
		other_future = Celluloid::Proxy::Future.new(actor.mailbox, actor.__klass__)
		
		expect(actor.future.eql? other_future).to be_truthy
	end
	
	it "should be possible to compare with non-proxy objects" do
		expect(actor.eql? "string").to be_falsey
		expect("string".eql? actor).to be_falsey
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
celluloid-0.17.4 spec/celluloid/proxy_spec.rb
celluloid-0.18.0.pre spec/celluloid/proxy_spec.rb
celluloid-0.17.3 spec/celluloid/proxy_spec.rb