Method: Minitest::Assertions#assert_predicate
- Defined in:
- lib/minitest/assertions.rb
#assert_predicate(o1, op, msg = nil) ⇒ Object
For testing with predicates. Eg:
assert_predicate str, :empty?
This is really meant for specs and is front-ended by assert_operator:
str.must_be :empty?
391 392 393 394 |
# File 'lib/minitest/assertions.rb', line 391 def assert_predicate o1, op, msg = nil msg = (msg) { "Expected #{mu_pp o1} to be #{op}" } assert o1.__send__(op), msg end |