class AssertExclusiveKeysTest
Public Instance Methods
test_should_not_raise_exception_if_no_keys_found()
click to toggle source
# File test/unit/assertions_test.rb, line 22 def test_should_not_raise_exception_if_no_keys_found assert_nothing_raised { assert_exclusive_keys({:on => :park}, :only, :except) } end
test_should_not_raise_exception_if_one_key_found()
click to toggle source
# File test/unit/assertions_test.rb, line 26 def test_should_not_raise_exception_if_one_key_found assert_nothing_raised { assert_exclusive_keys({:only => :parked}, :only, :except) } assert_nothing_raised { assert_exclusive_keys({:except => :parked}, :only, :except) } end
test_should_raise_exception_if_multiple_keys_found()
click to toggle source
# File test/unit/assertions_test.rb, line 36 def test_should_raise_exception_if_multiple_keys_found exception = assert_raise(ArgumentError) { assert_exclusive_keys({:only => :parked, :except => :parked, :on => :park}, :only, :except, :with) } assert_equal 'Conflicting keys: only, except', exception.message end
test_should_raise_exception_if_two_keys_found()
click to toggle source
# File test/unit/assertions_test.rb, line 31 def test_should_raise_exception_if_two_keys_found exception = assert_raise(ArgumentError) { assert_exclusive_keys({:only => :parked, :except => :parked}, :only, :except) } assert_equal 'Conflicting keys: only, except', exception.message end