Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
if $0 =~ /rspec$/
describe 'loltest' do
10_000.times do |i|
it "does #{i}" do
i.should == i
end
end
end
else
require 'minitest/autorun'
describe 'loltest' do
10_000.times do |i|
it "does #{i}" do
i.must_equal i
end
end
end
end
__END__
On my machine:
$ time ruby spec.rb
[ dots omitted ]
Finished tests in 0.911317s, 10973.1301 tests/s, 10973.1301 assertions/s.
10000 tests, 10000 assertions, 0 failures, 0 errors, 0 skips
real 0m1.488s
user 0m1.255s
sys 0m0.132s
$ time rspec spec.rb
[ dots omitted ]
Finished in 1.82 seconds
10000 examples, 0 failures
real 0m3.238s
user 0m2.755s
sys 0m0.241s
$ ruby -v
ruby 2.0.0dev (2012-06-09 trunk 35969) [x86_64-darwin11.4.0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.