Sha256: ffdca72bc041ea64dc31ef83c0c069f7576c7f47abffe1a948db30b902d65640
Contents?: true
Size: 932 Bytes
Versions: 14
Compression:
Stored size: 932 Bytes
Contents
require_relative '../../test_helper' class NodeCollectionTest < StateMachinesTest def setup @machine = StateMachines::Machine.new(Class.new) @collection = StateMachines::NodeCollection.new(@machine) end def test_should_raise_exception_if_invalid_option_specified exception = assert_raises(ArgumentError) { StateMachines::NodeCollection.new(@machine, invalid: true) } assert_equal 'Unknown key: :invalid. Valid keys are: :index', exception.message end def test_should_raise_exception_on_lookup_if_invalid_index_specified exception = assert_raises(ArgumentError) { @collection[:something, :invalid] } assert_equal 'Invalid index: :invalid', exception.message end def test_should_raise_exception_on_fetch_if_invalid_index_specified exception = assert_raises(ArgumentError) { @collection.fetch(:something, :invalid) } assert_equal 'Invalid index: :invalid', exception.message end end
Version data entries
14 entries across 14 versions & 2 rubygems