Sha256: 49651b726cd06e66ff455629d5a57ebf9de2b7c65a2be3049548cef8c0710ea8

Contents?: true

Size: 829 Bytes

Versions: 2

Compression:

Stored size: 829 Bytes

Contents

shared_context "a DCell registry" do
  context "node registry" do
    before :each do
      subject.clear_all_nodes
    end

    it "stores node addresses" do
      address = "tcp://localhost:7777"

      subject.set_node("foobar", address)
      subject.get_node("foobar").should == address
    end

    it "stores the IDs of all nodes" do
      subject.set_node("foobar", "tcp://localhost:7777")
      subject.nodes.should include "foobar"
    end
  end

  context "global registry" do
    before :each do
      subject.clear_globals
    end

    it "stores values" do
      subject.set_global("foobar", [1,2,3])
      subject.get_global("foobar").should == [1,2,3]
    end

    it "stores the keys of all globals" do
      subject.set_global("foobar", true)
      subject.global_keys.should include "foobar"
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
dcell-0.16.1 spec/support/registry_examples.rb
stn-dcell-0.16.0 spec/support/registry_examples.rb