Method: Minitest::Assertions#assert_missing_keys
- Defined in:
- lib/minitest-bonus-assertions.rb
#assert_missing_keys(obj, keys, msg = nil) ⇒ Object Also known as: refute_has_keys
Fails if obj has any of the keys listed.
63 64 65 66 67 68 69 |
# File 'lib/minitest-bonus-assertions.rb', line 63 def assert_missing_keys obj, keys, msg = nil keys = [ keys ] unless keys.kind_of?(Array) msg = (msg) { "Expected #{mu_pp(obj)} not to include any of these keys #{mu_pp(keys)}" } keys.none? { |key| refute obj.key?(key), msg } end |