Sha256: 347e1b4e5f6d2db6e89b5156c60c97e4396412d9ea4922daed74340fbcf3481b
Contents?: true
Size: 916 Bytes
Versions: 14
Compression:
Stored size: 916 Bytes
Contents
require_relative '../../test_helper' class AssertExclusiveKeysTest < StateMachinesTest def test_should_not_raise_exception_if_no_keys_found { on: :park }.assert_exclusive_keys(:only, :except) end def test_should_not_raise_exception_if_one_key_found { only: :parked }.assert_exclusive_keys(:only, :except) { except: :parked }.assert_exclusive_keys(:only, :except) end def test_should_raise_exception_if_two_keys_found exception = assert_raises(ArgumentError) { { only: :parked, except: :parked }.assert_exclusive_keys(:only, :except) } assert_equal 'Conflicting keys: only, except', exception.message end def test_should_raise_exception_if_multiple_keys_found exception = assert_raises(ArgumentError) { { only: :parked, except: :parked, on: :park }.assert_exclusive_keys(:only, :except, :with) } assert_equal 'Conflicting keys: only, except', exception.message end end
Version data entries
14 entries across 14 versions & 2 rubygems