blob: f481cf0242ab57d78e2a2b6c4c7ecf3863d4a9ba (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
|