Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Forked from dchelimsky/spec.rb
Created June 15, 2012 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tenderlove/2939021 to your computer and use it in GitHub Desktop.
Save tenderlove/2939021 to your computer and use it in GitHub Desktop.
# Note the differences between this and https://gist.github.com/2938965 are that
# we're making 10k groups with 2 examples each vs 10k group w/ 1 example.
if $0 =~ /rspec$/
10_000.times do |i|
describe "loltest #{i}" do
it "does #{i}" do
i.should eq i
end
it "does #{i}" do
i.should eq i
end
end
end
else
require 'minitest/autorun'
10_000.times do |i|
describe "loltest #{i}" do
it "does #{i}" do
i.must_equal i
end
it "does #{i}" do
i.must_equal i
end
end
end
end
__END__
On my machine:
$ time ruby spec.rb
Run options: --seed 25270
# Running tests:
[dots omitted]
Finished tests in 6.723914s, 2974.4580 tests/s, 2974.4580 assertions/s.
20000 tests, 20000 assertions, 0 failures, 0 errors, 0 skips
real 0m12.153s
user 0m10.144s
sys 0m0.329s
$ time rspec spec.rb
[dots omitted]
Finished in 7.4 seconds
20000 examples, 0 failures
real 0m16.510s
user 0m9.704s
sys 0m0.968s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment