rr 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,6 @@
1
+ * 0.1.13
2
+ - Fixed [#12290] Scenario#returns with false causes a return value of nil
3
+
1
4
  * 0.1.12
2
5
  - Fixed bug where Creators methods are not removed when methods are defined on Object
3
6
  - Fixed [#12289] Creators methods are not removed in Rails environment
data/Rakefile CHANGED
@@ -21,7 +21,7 @@ def run_suite
21
21
  end
22
22
 
23
23
  PKG_NAME = "rr"
24
- PKG_VERSION = "0.1.12"
24
+ PKG_VERSION = "0.1.13"
25
25
  PKG_FILES = FileList[
26
26
  '[A-Z]*',
27
27
  '*.rb',
@@ -307,6 +307,11 @@ describe Scenario, "#returns" do
307
307
  @scenario.call.should == :baz
308
308
  end
309
309
 
310
+ it "returns false when passed false" do
311
+ @scenario.returns(false)
312
+ @scenario.call.should == false
313
+ end
314
+
310
315
  it "raises an error when both argument and block is passed in" do
311
316
  proc do
312
317
  @scenario.returns(:baz) {:another}
@@ -215,10 +215,10 @@ module RR
215
215
  if value && implementation
216
216
  raise ArgumentError, "returns cannot accept both an argument and a block"
217
217
  end
218
- if value
219
- implemented_by proc {value}
220
- else
218
+ if value.nil?
221
219
  implemented_by implementation
220
+ else
221
+ implemented_by proc {value}
222
222
  end
223
223
  end
224
224
 
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.3
3
3
  specification_version: 1
4
4
  name: rr
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.12
6
+ version: 0.1.13
7
7
  date: 2007-07-14 00:00:00 -07:00
8
8
  summary: RR (Double Ruby) is a double framework that features a rich selection of double techniques and a terse syntax. http://xunitpatterns.com/Test%20Double.html
9
9
  require_paths: