Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formula_assertions: few more compat methods #10727

Merged
merged 1 commit into from
Feb 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions Library/Homebrew/formula_assertions.rb
Expand Up @@ -20,18 +20,23 @@ def assertions

# Test::Unit backwards compatibility methods
{
assert_include: :assert_includes,
assert_path_exist: :assert_path_exists,
assert_raise: :assert_raises,
assert_throw: :assert_throws,
assert_not_empty: :refute_empty,
assert_not_equal: :refute_equal,
assert_not_in_delta: :refute_in_delta,
assert_not_in_epsilon: :refute_in_epsilon,
assert_not_include: :refute_includes,
assert_not_includes: :refute_includes,
assert_not_instance_of: :refute_instance_of,
assert_not_kind_of: :refute_kind_of,
assert_not_match: :refute_match,
assert_no_match: :refute_match,
assert_not_nil: :refute_nil,
assert_not_operator: :refute_operator,
assert_path_not_exist: :refute_path_exists,
assert_not_predicate: :refute_predicate,
assert_not_respond_to: :refute_respond_to,
assert_not_same: :refute_same,
Expand All @@ -47,6 +52,11 @@ def assert_true(act, msg = nil)
assert_equal(true, act, msg)
end

def assert_false(act, msg = nil)
# odeprecated "assert_false", "assert(!...) or assert_equal(false, ...)"
assert_equal(false, act, msg)
end

# Returns the output of running cmd, and asserts the exit status.
# @api public
def shell_output(cmd, result = 0)
Expand Down