rr 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES
CHANGED
data/Rakefile
CHANGED
@@ -2,6 +2,16 @@ require "examples/example_helper"
|
|
2
2
|
|
3
3
|
module RR
|
4
4
|
module Expectations
|
5
|
+
describe ArgumentEqualityExpectation, "expected_arguments" do
|
6
|
+
before do
|
7
|
+
@expectation = AnyArgumentExpectation.new
|
8
|
+
end
|
9
|
+
|
10
|
+
it "returns an empty array" do
|
11
|
+
@expectation.expected_arguments.should == []
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
5
15
|
describe AnyArgumentExpectation, "==" do
|
6
16
|
before do
|
7
17
|
@expectation = AnyArgumentExpectation.new
|
@@ -2,6 +2,16 @@ require "examples/example_helper"
|
|
2
2
|
|
3
3
|
module RR
|
4
4
|
module Expectations
|
5
|
+
describe ArgumentEqualityExpectation, "expected_arguments" do
|
6
|
+
before do
|
7
|
+
@expectation = ArgumentEqualityExpectation.new(1, 2, 3)
|
8
|
+
end
|
9
|
+
|
10
|
+
it "returns the passed in expected_arguments" do
|
11
|
+
@expectation.expected_arguments.should == [1, 2, 3]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
5
15
|
describe ArgumentEqualityExpectation, "==" do
|
6
16
|
before do
|
7
17
|
@expectation = ArgumentEqualityExpectation.new(1, 2, 3)
|
@@ -1,6 +1,10 @@
|
|
1
1
|
module RR
|
2
2
|
module Expectations
|
3
|
-
class AnyArgumentExpectation
|
3
|
+
class AnyArgumentExpectation < ArgumentEqualityExpectation
|
4
|
+
def initialize
|
5
|
+
super
|
6
|
+
end
|
7
|
+
|
4
8
|
def exact_match?(*arguments)
|
5
9
|
false
|
6
10
|
end
|
@@ -10,7 +14,7 @@ module RR
|
|
10
14
|
end
|
11
15
|
|
12
16
|
def ==(other)
|
13
|
-
self.class
|
17
|
+
other.is_a?(self.class)
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
data/lib/rr/scenario.rb
CHANGED
@@ -29,8 +29,8 @@ module RR
|
|
29
29
|
@yields = nil
|
30
30
|
end
|
31
31
|
|
32
|
-
# Scenario#with
|
33
|
-
#
|
32
|
+
# Scenario#with sets the expectation that the Scenario will receive
|
33
|
+
# the passed in arguments.
|
34
34
|
#
|
35
35
|
# Passing in a block sets the return value.
|
36
36
|
#
|
@@ -41,8 +41,8 @@ module RR
|
|
41
41
|
self
|
42
42
|
end
|
43
43
|
|
44
|
-
# Scenario#with_any_args
|
45
|
-
#
|
44
|
+
# Scenario#with_any_args sets the expectation that the Scenario can receive
|
45
|
+
# any arguments.
|
46
46
|
#
|
47
47
|
# Passing in a block sets the return value.
|
48
48
|
#
|
@@ -53,8 +53,8 @@ module RR
|
|
53
53
|
self
|
54
54
|
end
|
55
55
|
|
56
|
-
# Scenario#with_no_args
|
57
|
-
# no arguments
|
56
|
+
# Scenario#with_no_args sets the expectation that the Scenario will receive
|
57
|
+
# no arguments.
|
58
58
|
#
|
59
59
|
# Passing in a block sets the return value.
|
60
60
|
#
|
@@ -65,7 +65,7 @@ module RR
|
|
65
65
|
self
|
66
66
|
end
|
67
67
|
|
68
|
-
# Scenario#never sets
|
68
|
+
# Scenario#never sets the expectation that the Scenario will never be
|
69
69
|
# called.
|
70
70
|
#
|
71
71
|
# This method does not accept a block because it will never be called.
|
@@ -76,7 +76,7 @@ module RR
|
|
76
76
|
self
|
77
77
|
end
|
78
78
|
|
79
|
-
# Scenario#once sets
|
79
|
+
# Scenario#once sets the expectation that the Scenario will be called
|
80
80
|
# 1 time.
|
81
81
|
#
|
82
82
|
# Passing in a block sets the return value.
|
@@ -88,7 +88,7 @@ module RR
|
|
88
88
|
self
|
89
89
|
end
|
90
90
|
|
91
|
-
# Scenario#twice sets
|
91
|
+
# Scenario#twice sets the expectation that the Scenario will be called
|
92
92
|
# 2 times.
|
93
93
|
#
|
94
94
|
# Passing in a block sets the return value.
|
@@ -100,7 +100,7 @@ module RR
|
|
100
100
|
self
|
101
101
|
end
|
102
102
|
|
103
|
-
# Scenario#at_least sets
|
103
|
+
# Scenario#at_least sets the expectation that the Scenario
|
104
104
|
# will be called at least n times.
|
105
105
|
# It works by creating a TimesCalledExpectation.
|
106
106
|
#
|
@@ -114,7 +114,7 @@ module RR
|
|
114
114
|
self
|
115
115
|
end
|
116
116
|
|
117
|
-
# Scenario#at_most allows sets
|
117
|
+
# Scenario#at_most allows sets the expectation that the Scenario
|
118
118
|
# will be called at most n times.
|
119
119
|
# It works by creating a TimesCalledExpectation.
|
120
120
|
#
|
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.10
|
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:
|