class AssertValidKeysTest
Public Instance Methods
test_should_not_raise_exception_if_key_is_valid()
click to toggle source
# File test/unit/assertions_test.rb, line 11 def test_should_not_raise_exception_if_key_is_valid assert_nothing_raised { assert_valid_keys({:name => 'foo', :value => 'bar'}, :name, :value, :force) } end
test_should_raise_exception_if_key_is_invalid()
click to toggle source
# File test/unit/assertions_test.rb, line 15 def test_should_raise_exception_if_key_is_invalid exception = assert_raise(ArgumentError) { assert_valid_keys({:name => 'foo', :value => 'bar', :invalid => true}, :name, :value, :force) } assert_equal 'Invalid key(s): invalid', exception.message end