class NodeCollectionWithoutIndicesTest

Public Instance Methods

setup() click to toggle source
# File test/unit/node_collection_test.rb, line 100
def setup
  machine = StateMachine::Machine.new(Class.new)
  @collection = StateMachine::NodeCollection.new(machine, :index => {})
end
test_should_allow_adding_node() click to toggle source
# File test/unit/node_collection_test.rb, line 105
def test_should_allow_adding_node
  @collection << Object.new
  assert_equal 1, @collection.length
end
test_should_not_allow_fetching() click to toggle source
# File test/unit/node_collection_test.rb, line 121
def test_should_not_allow_fetching
  @collection << object = Object.new
  exception = assert_raise(ArgumentError) { @collection.fetch(0) }
  assert_equal 'No indices configured', exception.message
end
test_should_not_allow_keys_retrieval() click to toggle source
# File test/unit/node_collection_test.rb, line 110
def test_should_not_allow_keys_retrieval
  exception = assert_raise(ArgumentError) { @collection.keys }
  assert_equal 'No indices configured', exception.message
end
test_should_not_allow_lookup() click to toggle source
# File test/unit/node_collection_test.rb, line 115
def test_should_not_allow_lookup
  @collection << object = Object.new
  exception = assert_raise(ArgumentError) { @collection[0] }
  assert_equal 'No indices configured', exception.message
end