Sha256: af62a52996d3d75cae948839f4ce08d10cc5778b1ea73cc1b178b14fec7c919b

Contents?: true

Size: 685 Bytes

Versions: 1

Compression:

Stored size: 685 Bytes

Contents

require 'drb_node.rb'
def resetLog
  $log=""
end
def log(*s)
  $log||=""
  if s.length>0
    s=s.join(" ")
    $log<<s<<";"
    puts s
  end
  $log
end

if false
describe "Drb Node" do
  it "should connect to another node" do
    a=DrbNetNode.new(4000,nil)
    class DrbNetNode
      def hi(*what)
        @hi=what.join("") if what.length>0
        @hi
      end
    end
    b=DrbNetNode.new(4041,nil)
    a.connect(b.id)
    b.sendAll(:hi,"hello1")
    a.sendAll(:hi,"hello2")
    a.hi.should == "hello1"
    b.hi.should == "hello2"
    b.close(a.node)
    b.sendAll(:hi,"hello3")
    a.sendAll(:hi,"hello4")
    a.hi.should == "hello1"
    b.hi.should == "hello2"
  end
end


  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
appswarm-0.0.1 apps/network_node/spec/drb_spec.rb