-
-
Save afcapel/10634495 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$ time ruby rspec.rb && time ruby minispec.rb && time ruby minitest.rb | |
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. | |
Finished in 3.37 seconds | |
1501 examples, 0 failures | |
real 0m3.666s | |
user 0m0.747s | |
sys 0m0.145s | |
Run options: --seed 23693 | |
# Running: | |
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. | |
Finished in 3.156915s, 475.4642 runs/s, 3642.7968 assertions/s. | |
1501 runs, 11500 assertions, 0 failures, 0 errors, 0 skips | |
real 0m3.488s | |
user 0m0.574s | |
sys 0m0.141s | |
Run options: --seed 45238 | |
# Running: | |
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. | |
Finished in 3.097505s, 484.5836 runs/s, 3712.6655 assertions/s. | |
1501 runs, 11500 assertions, 0 failures, 0 errors, 0 skips | |
real 0m3.410s | |
user 0m0.500s | |
sys 0m0.141s |
This file contains hidden or 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
require 'minitest/autorun' | |
describe "MiniSpec" do | |
before do | |
@numbers = 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 | |
end | |
it "is fast" do | |
sleep(1) | |
(1..5000).each do |n| | |
n.must_equal(n) | |
refute_nil n | |
end | |
end | |
(1..1500).each do |n| | |
it "is example #{n}" do | |
sleep(0.001) | |
refute_nil (1 * @numbers) | |
end | |
end | |
after(:each) do | |
@numbers = nil | |
end | |
end |
This file contains hidden or 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
require 'minitest/autorun' | |
class MinitestTest < Minitest::Test | |
def setup | |
@numbers = 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 | |
end | |
def teardown | |
@numbers = nil | |
end | |
def test_is_fast | |
sleep(1) | |
(1..5000).each do |n| | |
assert_equal n, n | |
refute n.zero? | |
end | |
end | |
(1..1500).each do |n| | |
define_method("test_is_example#{n}") do | |
sleep(0.001) | |
refute_nil (1 * @numbers) | |
end | |
end | |
end |
This file contains hidden or 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
require 'rspec/autorun' | |
describe "RSpec" do | |
before(:each) do | |
@numbers = 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 | |
end | |
it "is fast" do | |
sleep(1) | |
(1..5000).each do |n| | |
n.should eq(n) | |
n.should_not be_zero | |
end | |
end | |
(1..1500).each do |n| | |
it "is example #{n}" do | |
sleep(0.001) | |
(1 * @numbers).should_not be_nil | |
end | |
end | |
after(:each) do | |
@numbers = nil | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment