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 +3 -0
- data/Rakefile +1 -1
- data/examples/rr/scenario_example.rb +5 -0
- data/lib/rr/scenario.rb +3 -3
- metadata +1 -1
data/CHANGES
CHANGED
data/Rakefile
CHANGED
@@ -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}
|
data/lib/rr/scenario.rb
CHANGED
@@ -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.
|
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:
|