mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-09 12:46:07 +10:00
Evaluate benchmark blocks in the proper context
This ensures that blocks defines using "benchmark_subject" have access to methods defined using let/subject & friends.
This commit is contained in:
@@ -38,7 +38,9 @@ module BenchmarkMatchers
|
||||
# Benchmarks the given block and returns a Benchmark::IPS::Report::Entry.
|
||||
def benchmark(&block)
|
||||
report = Benchmark.ips(quiet: true) do |bench|
|
||||
bench.report(&block)
|
||||
bench.report do
|
||||
instance_eval(&block)
|
||||
end
|
||||
end
|
||||
|
||||
report.entries[0]
|
||||
|
||||
Reference in New Issue
Block a user