Sha256: 6f543a731d40ba87e9df1c998cf5e0d2f385838200541ea8aaadf2a2e8feba66

Contents?: true

Size: 984 Bytes

Versions: 8

Compression:

Stored size: 984 Bytes

Contents

require_relative '../test-util'

describe 'Rinda patch' do
  it 'should be different tuples that have different contentes' do
    ts = Rinda::TupleSpace.new
    e1 = ts.write([:abc, 1])
    e2 = ts.write([:abc, 2])
    e1.should.not == e2
    e2.should.not == e1
    ts.read_all([:abc, nil]).should == [[:abc, 1], [:abc, 2]]
    ts.read([:abc, 1]).should == [:abc, 1]
    ts.read([:abc, 2]).should == [:abc, 2]
  end

  it 'should not unify normal tuples' do
    ts = Rinda::TupleSpace.new
    e1 = ts.write([:abc, 1])
    e2 = ts.write([:abc, 1])
    e1.should == e2
    e2.should == e1
    ts.read_all([:abc, nil]).should == [[:abc, 1], [:abc, 1]]
    ts.read([:abc, 1]).should == [:abc, 1]
  end

  it 'should unify domain based tuples' do
    ts = Rinda::TupleSpace.new
    ts.write([:working, "test", "test"])
    ts.write([:working, "test", "test"])
    ts.write([:working, "test", "test"])
    ts.read_all([:working, nil, nil]).should == [[:working, "test", "test"]]
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pione-0.2.2 test/patch/spec_rinda-patch.rb
pione-0.2.1 test/patch/spec_rinda-patch.rb
pione-0.2.0 test/patch/spec_rinda-patch.rb
pione-0.1.4 test/patch/spec_rinda-patch.rb
pione-0.1.3 test/patch/spec_rinda-patch.rb
pione-0.1.2 test/patch/spec_rinda-patch.rb
pione-0.1.1 test/patch/spec_rinda-patch.rb
pione-0.1.0 test/patch/spec_rinda-patch.rb