diff options
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/hash_ext_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb new file mode 100644 index 0000000000..f481cf0242 --- /dev/null +++ b/activesupport/test/core_ext/hash_ext_test.rb @@ -0,0 +1,14 @@ +require 'test/unit' +require File.dirname(__FILE__) + '/../../lib/core_ext/hash_ext' + +class HashExtTest < Test::Unit::TestCase + def test_assert_valid_keys + assert_nothing_raised do + { :failure => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ]) + end + + assert_raises(ArgumentError, "Unknown key(s): failore") do + { :failore => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ]) + end + end +end
\ No newline at end of file |