should_be_faster 0.0.1 → 0.0.2

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 (2) hide show
  1. data/lib/should_be_faster.rb +5 -2
  2. metadata +18 -9
@@ -78,12 +78,14 @@ module Spec
78
78
 
79
79
  class BePredicate < Be
80
80
  def times
81
+ @factor = @args[0]
81
82
  self
82
83
  end
83
84
 
84
85
  def faster_than(rhs_code, options={})
86
+ options ||= {}
87
+ options[:factor] = @factor
85
88
  Matcher.new(:faster_than) do
86
- options ||= {}
87
89
  options[:faster] = true
88
90
  options[:matcher] = self
89
91
  Spec::Matchers::BenchmarkComparison.new(rhs_code, options).benchmark_comparison
@@ -91,8 +93,9 @@ module Spec
91
93
  end
92
94
 
93
95
  def slower_than(rhs_code, options={})
96
+ options ||= {}
97
+ options[:factor] = @factor
94
98
  Matcher.new(:slower_than) do
95
- options ||= {}
96
99
  options[:faster] = false
97
100
  options[:matcher] = self
98
101
  Spec::Matchers::BenchmarkComparison.new(rhs_code, options).benchmark_comparison
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: should_be_faster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 2
9
+ version: 0.0.2
5
10
  platform: ruby
6
11
  authors:
7
12
  - David Turnbull
@@ -9,19 +14,21 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-02-16 00:00:00 +11:00
17
+ date: 2010-04-11 00:00:00 +10:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: rspec
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
23
29
  version: "0"
24
- version:
30
+ type: :runtime
31
+ version_requirements: *id001
25
32
  description:
26
33
  email: dsturnbull@gmail.com
27
34
  executables: []
@@ -46,18 +53,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
46
53
  requirements:
47
54
  - - ">="
48
55
  - !ruby/object:Gem::Version
56
+ segments:
57
+ - 0
49
58
  version: "0"
50
- version:
51
59
  required_rubygems_version: !ruby/object:Gem::Requirement
52
60
  requirements:
53
61
  - - ">="
54
62
  - !ruby/object:Gem::Version
63
+ segments:
64
+ - 0
55
65
  version: "0"
56
- version:
57
66
  requirements: []
58
67
 
59
68
  rubyforge_project:
60
- rubygems_version: 1.3.5
69
+ rubygems_version: 1.3.6
61
70
  signing_key:
62
71
  specification_version: 3
63
72
  summary: provides rspec matcher to do simple benchmark tests