benchmark-spec 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/benchmark_spec.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96adc8aefa1d460eb633d603c73a9b214370c2a6
|
4
|
+
data.tar.gz: 490d20bcf05ac6c75020a1f5344f142288407d18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ebeb97861fd87cad869ca51980ce9650a6b6193f3f129186f509d3459e1f69dcaf3d2ad9a00803355572a2a302175c53722fbca477f0a19ff845b2ba56801ef
|
7
|
+
data.tar.gz: 9c903378f8092ca8317787e77380d77a3c73dd6e7ff8bcd5d59455694ddf6b76c7b5f257e0078edceab22cd7ffe80d5f05284e6d642630a2a3976944b0f98400
|
data/lib/benchmark_spec.rb
CHANGED
@@ -34,7 +34,7 @@ class BenchmarkSpec
|
|
34
34
|
@formatter = opts[:formatter] || OutputFormatter.new
|
35
35
|
|
36
36
|
@config ||= {}
|
37
|
-
instance_exec @config, &config_proc
|
37
|
+
instance_exec @config, &config_proc if config_proc
|
38
38
|
end
|
39
39
|
|
40
40
|
class << self
|
@@ -117,8 +117,10 @@ class BenchmarkSpec
|
|
117
117
|
formatter.print "running #{t[:description]} ..."
|
118
118
|
|
119
119
|
before_each_hooks.each {|b| b.call}
|
120
|
-
|
120
|
+
report = Benchmark.measure(t[:description], &t[:execution])
|
121
121
|
after_each_hooks.each {|a| a.call}
|
122
|
+
|
123
|
+
reports << report
|
122
124
|
rescue => e
|
123
125
|
formatter.print "Error: #{e.message}".colorize(:red)
|
124
126
|
end
|