Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 3301d30332
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (30 sloc) 0.544 kB
require 'benchmark'
require 'tmpdir'
path = File.join(Dir.tmpdir, "benchmark_example_spec.rb")
File.open(path, 'w') do |f|
f.puts %q|describe "something" do|
100.times do |n|
f.puts <<-TEXT
it "does something #{n}", :focus => true do
end
TEXT
end
100.times do |n|
f.puts <<-TEXT
it "does something else #{n}" do
end
TEXT
end
f.puts %q|end|
end
n = 1
Benchmark.benchmark do |bm|
3.times do
bm.report do
n.times do
`bin/rspec --tag focus #{path}`
end
end
end
end
File.delete(path)
Jump to Line
Something went wrong with that request. Please try again.