Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created April 5, 2015 06:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tenderlove/253f6eee35ec3578f0b6 to your computer and use it in GitHub Desktop.
Save tenderlove/253f6eee35ec3578f0b6 to your computer and use it in GitHub Desktop.
require 'minitest/autorun'
class FooTest < Minitest::Test
def self.profile name
define_method("test_profile_#{name}") do
# start timer
10.times { send name }
# end timer
if performace_regresses
flunk "you failed"
end
end
end
def test_thing
assert true
end
profile :test_thing
end
@toch
Copy link

toch commented Jul 31, 2015

@tenderlove, finally wrap up everything together: https://github.com/toch/minitest-perf_regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment