Sha256: 8e12654846c2c58ad541c73d42cd6d8d596e4e8248b59aa26ac6e572c8d10193

Contents?: true

Size: 980 Bytes

Versions: 9

Compression:

Stored size: 980 Bytes

Contents

require 'pione/test-helper'

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

9 entries across 9 versions & 1 rubygems

Version Path
pione-0.5.0 test/patch/spec_rinda-patch.rb
pione-0.5.0.alpha.2 test/patch/spec_rinda-patch.rb
pione-0.5.0.alpha.1 test/patch/spec_rinda-patch.rb
pione-0.4.2 test/patch/spec_rinda-patch.rb
pione-0.4.1 test/patch/spec_rinda-patch.rb
pione-0.4.0 test/patch/spec_rinda-patch.rb
pione-0.3.2 test/patch/spec_rinda-patch.rb
pione-0.3.1 test/patch/spec_rinda-patch.rb
pione-0.3.0 test/patch/spec_rinda-patch.rb