Sha256: f9dfa05564d8368290f779c822fa2a7c6881d8794c38dd3ac635a5f8a598892a

Contents?: true

Size: 756 Bytes

Versions: 9

Compression:

Stored size: 756 Bytes

Contents

require 'pione/test-helper'

class TestTupleSpaceClient < Agent::TupleSpaceClient
  set_agent_type :test_tuple_space_client, self

  define_transition :sleep

  chain :init => :sleep

  def transit_to_sleep
    Thread.stop
  end
end

describe 'Pione::Agent::TupleSpaceClient' do
  before do
    @space = TestHelper::TupleSpace.create(self)
  end

  after do
    @space.terminate
  end

  it 'should say "hello"' do
    agent = TestTupleSpaceClient.start(@space)
    agent.wait_until(:sleep)
    t1 = read!(TupleSpace::AgentTuple.new(agent_type: :test_tuple_space_client))
    t1.should.not.nil
    t1.uuid.should == agent.uuid
    agent.terminate
    t2 = read!(TupleSpace::AgentTuple.new(agent_type: :test_tuple_space_client))
    t2.should.nil
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pione-0.5.0 test/agent/spec_tuple-space-client.rb
pione-0.5.0.alpha.2 test/agent/spec_tuple-space-client.rb
pione-0.5.0.alpha.1 test/agent/spec_tuple-space-client.rb
pione-0.4.2 test/agent/spec_tuple-space-client.rb
pione-0.4.1 test/agent/spec_tuple-space-client.rb
pione-0.4.0 test/agent/spec_tuple-space-client.rb
pione-0.3.2 test/agent/spec_tuple-space-client.rb
pione-0.3.1 test/agent/spec_tuple-space-client.rb
pione-0.3.0 test/agent/spec_tuple-space-client.rb