minitest-assertify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MiniTest | |
module Assertify | |
module Lifecycle # :nodoc: | |
# Hook into Minitest's Lifecycle to alias methods when tests are run. | |
def before_setup # :nodoc: | |
self.class.public_instance_methods.grep(/\Arefute_/).each do |method| | |
new_method = method.to_s.sub("refute_", "assert_not_").to_sym | |
class_eval do | |
alias_method new_method, method | |
end | |
end | |
super | |
end | |
end | |
end | |
class Unit # :nodoc: | |
class TestCase # :nodoc: | |
# Register the Lifecycle | |
include MiniTest::Assertify::Lifecycle | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment