Method: Minitest::Assertions#assert_operator
- Defined in:
- lib/minitest/assertions.rb
#assert_operator(o1, op, o2 = UNDEFINED, msg = nil) ⇒ Object
For testing with binary operators. Eg:
assert_operator 5, :<=, 4
237 238 239 240 241 |
# File 'lib/minitest/assertions.rb', line 237 def assert_operator o1, op, o2 = UNDEFINED, msg = nil return assert_predicate o1, op, msg if UNDEFINED == o2 msg = (msg) { "Expected #{mu_pp(o1)} to be #{op} #{mu_pp(o2)}" } assert o1.__send__(op, o2), msg end |