Skip to content

Instantly share code, notes, and snippets.

@Rodrigora
Created February 11, 2015 21:08
Show Gist options
  • Save Rodrigora/cb9125ec5911a1c37ed1 to your computer and use it in GitHub Desktop.
Save Rodrigora/cb9125ec5911a1c37ed1 to your computer and use it in GitHub Desktop.
All Minitest Assertions
def assert test, msg = nil
def assert_empty obj, msg = nil
def assert_equal exp, act, msg = nil
def assert_in_delta exp, act, delta = 0.001, msg = nil
def assert_in_epsilon a, b, epsilon = 0.001, msg = nil
def assert_includes collection, obj, msg = nil
def assert_instance_of cls, obj, msg = nil
def assert_kind_of cls, obj, msg = nil
def assert_match matcher, obj, msg = nil
def assert_nil obj, msg = nil
def assert_operator o1, op, o2 = UNDEFINED, msg = nil
def assert_output stdout = nil, stderr = nil
def assert_predicate o1, op, msg = nil
def assert_raises *exp
def assert_respond_to obj, meth, msg = nil
def assert_same exp, act, msg = nil
def assert_send send_ary, m = nil
def assert_silent
def assert_throws sym, msg = nil
# refute
def refute test, msg = nil
def refute_empty obj, msg = nil
def refute_equal exp, act, msg = nil
def refute_in_delta exp, act, delta = 0.001, msg = nil
def refute_in_epsilon a, b, epsilon = 0.001, msg = nil
def refute_includes collection, obj, msg = nil
def refute_instance_of cls, obj, msg = nil
def refute_kind_of cls, obj, msg = nil
def refute_match matcher, obj, msg = nil
def refute_nil obj, msg = nil
def refute_operator o1, op, o2 = UNDEFINED, msg = nil
def refute_predicate o1, op, msg = nil
def refute_same exp, act, msg = nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment