Sha256: 54ef559f1c5024490a7d05ba84dda22dcbb99012cf8131c7708d313d0aaa4ade
Contents?: true
Size: 839 Bytes
Versions: 14
Compression:
Stored size: 839 Bytes
Contents
require_relative '../../test_helper' class BranchTest < StateMachinesTest def setup @branch = StateMachines::Branch.new(from: :parked, to: :idling) end def test_should_not_raise_exception_if_implicit_option_specified StateMachines::Branch.new(invalid: :valid) end def test_should_not_have_an_if_condition assert_nil @branch.if_condition end def test_should_not_have_an_unless_condition assert_nil @branch.unless_condition end def test_should_have_a_state_requirement assert_equal 1, @branch.state_requirements.length end def test_should_raise_an_exception_if_invalid_match_option_specified exception = assert_raises(ArgumentError) { @branch.match(Object.new, invalid: true) } assert_equal 'Unknown key: :invalid. Valid keys are: :from, :to, :on, :guard', exception.message end end
Version data entries
14 entries across 14 versions & 2 rubygems