Sha256: df7828b095a2d7b4829a5563742ead9998d5c639b31354868377f12f036bd83b

Contents?: true

Size: 645 Bytes

Versions: 2

Compression:

Stored size: 645 Bytes

Contents

require 'spec_helper'

describe DCell::Global do
  it "can handle unexisting keys" do
    expect { DCell::Global[:unexisting] }.to_not raise_exception
  end

  it "stores values" do
    DCell::Global[:the_answer] = 42
    DCell::Global[:the_answer].should == 42

    # Double check the global value is available on all nodes
    node = DCell::Node[TEST_NODE[:id]]
    node[:test_actor].the_answer.should == 42
  end

  it "stores the keys of all globals" do
    DCell::Global[:foo] = 1
    DCell::Global[:bar] = 2
    DCell::Global[:baz] = 3

    keys = DCell::Global.keys
    [:foo, :bar, :baz].each { |key| keys.should include key }
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
dcell-0.16.1 spec/dcell/global_spec.rb
stn-dcell-0.16.0 spec/dcell/global_spec.rb