benchmark-spec 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/benchmark_spec.rb +4 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3cd3bdfc2fd59ef5a535b3696f77bab75bdaa5c4
4
- data.tar.gz: f36a7617e89940b0c40527304e82d2bba2ab6deb
3
+ metadata.gz: 96adc8aefa1d460eb633d603c73a9b214370c2a6
4
+ data.tar.gz: 490d20bcf05ac6c75020a1f5344f142288407d18
5
5
  SHA512:
6
- metadata.gz: 3d77dbe11945fe05d45c880db95c74fc36acad7fedd8627810fa3ccc017baae7e470edacf8c9900b6cc13f12abe50db6c6d3f187c965b36de5e29684e6dbf332
7
- data.tar.gz: 6f54357825e3bad8c152df4b12056e0431a9b7de726c941ddcee9b1037b2e75d0356fcee7218238aef40d1b91cea2f2e4c720c0598484f1eabb9b0342150e001
6
+ metadata.gz: 1ebeb97861fd87cad869ca51980ce9650a6b6193f3f129186f509d3459e1f69dcaf3d2ad9a00803355572a2a302175c53722fbca477f0a19ff845b2ba56801ef
7
+ data.tar.gz: 9c903378f8092ca8317787e77380d77a3c73dd6e7ff8bcd5d59455694ddf6b76c7b5f257e0078edceab22cd7ffe80d5f05284e6d642630a2a3976944b0f98400
@@ -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
- reports << Benchmark.measure(t[:description]) { t[:execution].call }
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark-spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edward Tam