fakes-rspec 1.0.6 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fakes_rspec/matcher.rb +1 -1
- data/lib/fakes_rspec/version.rb +1 -1
- data/spec/specs/received_occurrences_criteria_spec.rb +2 -2
- data/spec/specs/usage_spec.rb +26 -26
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a31d41eefe7f164425a119dfc161ae76b5dc97f5
|
4
|
+
data.tar.gz: 386040e2e3f3d321ea271e7da32e4f36bff8154f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4f539e4bdd5d82f65c604a8f1cb5821f67ffa9bd0152774433f8a285afc8073eec87442d7db13b135ffd3a76ebb2d13b60dced80c42ee2700890f991bc148d7
|
7
|
+
data.tar.gz: 7630d8f7f2fec481fcb3fa8cb4d779a0e9b7b39258aa13d35676ac5a40e0d42f2fd435c1f36ddd441d9ceb91dfe80c85d755f2afd10ee405cef534c63ca4e532
|
data/lib/fakes_rspec/matcher.rb
CHANGED
@@ -6,7 +6,7 @@ module RSpec
|
|
6
6
|
return Fakes::RSpec::ReceivedOccurrencesCriteria.new(create_received_criteria_from(the_call),the_call,occurence)
|
7
7
|
end
|
8
8
|
|
9
|
-
Matchers.define :
|
9
|
+
Matchers.define :have_received_message do|symbol,*args|
|
10
10
|
@occurence_spec = Fakes::RSpec::NulloSpecification.instance
|
11
11
|
|
12
12
|
chain :once do
|
data/lib/fakes_rspec/version.rb
CHANGED
@@ -18,8 +18,8 @@ module Fakes
|
|
18
18
|
subject.is_satisfied_by(the_arg).should be_false
|
19
19
|
end
|
20
20
|
it "should not use the occurrence or the call" do
|
21
|
-
occurrence.should_not
|
22
|
-
the_call.should_not
|
21
|
+
occurrence.should_not have_received_message(:is_satisfied_by)
|
22
|
+
the_call.should_not have_received_message(:called_with)
|
23
23
|
end
|
24
24
|
end
|
25
25
|
context "and the original criteria is satisfied" do
|
data/spec/specs/usage_spec.rb
CHANGED
@@ -6,11 +6,11 @@ describe "using the rspec extensions" do
|
|
6
6
|
item.hello
|
7
7
|
item.last("other")
|
8
8
|
|
9
|
-
item.should_not
|
10
|
-
item.should
|
11
|
-
item.should_not
|
12
|
-
item.should_not
|
13
|
-
item.should
|
9
|
+
item.should_not have_received_message(:hello,"world")
|
10
|
+
item.should have_received_message(:hello)
|
11
|
+
item.should_not have_received_message(:once_more)
|
12
|
+
item.should_not have_received_message(:last,"hello")
|
13
|
+
item.should have_received_message(:last,"other")
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should be able to determine if a call has been made a certain number of times" do
|
@@ -19,20 +19,20 @@ describe "using the rspec extensions" do
|
|
19
19
|
item.hello
|
20
20
|
item.last("other")
|
21
21
|
|
22
|
-
item.should_not
|
23
|
-
item.should
|
24
|
-
item.should
|
25
|
-
item.should_not
|
26
|
-
item.should_not
|
27
|
-
item.should
|
28
|
-
item.should_not
|
22
|
+
item.should_not have_received_message(:hello,"world")
|
23
|
+
item.should have_received_message(:hello).twice
|
24
|
+
item.should have_received_message(:hello)
|
25
|
+
item.should_not have_received_message(:once_more)
|
26
|
+
item.should_not have_received_message(:last,"hello")
|
27
|
+
item.should have_received_message(:last,"other").once
|
28
|
+
item.should_not have_received_message(:last).twice
|
29
29
|
end
|
30
30
|
|
31
31
|
it "should be able to determine if a call was made once" do
|
32
32
|
item = fake
|
33
33
|
item.hello
|
34
34
|
|
35
|
-
item.should
|
35
|
+
item.should have_received_message(:hello).once
|
36
36
|
end
|
37
37
|
|
38
38
|
it "should be able to determine if a call was made twice" do
|
@@ -40,7 +40,7 @@ describe "using the rspec extensions" do
|
|
40
40
|
item.hello
|
41
41
|
item.hello
|
42
42
|
|
43
|
-
item.should
|
43
|
+
item.should have_received_message(:hello).twice
|
44
44
|
end
|
45
45
|
|
46
46
|
it "should be able to determine if a call was made at least once" do
|
@@ -48,7 +48,7 @@ describe "using the rspec extensions" do
|
|
48
48
|
item.hello
|
49
49
|
item.hello
|
50
50
|
|
51
|
-
item.should
|
51
|
+
item.should have_received_message(:hello).at_least_once
|
52
52
|
end
|
53
53
|
|
54
54
|
it "should be able to determine if a call was made at least twice" do
|
@@ -57,8 +57,8 @@ describe "using the rspec extensions" do
|
|
57
57
|
item.hello
|
58
58
|
item.hello
|
59
59
|
|
60
|
-
item.should
|
61
|
-
item.should
|
60
|
+
item.should have_received_message(:hello).at_least_twice
|
61
|
+
item.should have_received_message(:hello).at_least_twice
|
62
62
|
end
|
63
63
|
|
64
64
|
|
@@ -68,8 +68,8 @@ describe "using the rspec extensions" do
|
|
68
68
|
item.goodbye
|
69
69
|
item.goodbye
|
70
70
|
|
71
|
-
item.should
|
72
|
-
item.should_not
|
71
|
+
item.should have_received_message(:hello).at_most_once
|
72
|
+
item.should_not have_received_message(:goodbye).at_most_once
|
73
73
|
end
|
74
74
|
|
75
75
|
it "should be able to determine if a call was made at most twice" do
|
@@ -79,8 +79,8 @@ describe "using the rspec extensions" do
|
|
79
79
|
item.goodbye
|
80
80
|
item.goodbye
|
81
81
|
|
82
|
-
item.should
|
83
|
-
item.should_not
|
82
|
+
item.should have_received_message(:hello).at_most_twice
|
83
|
+
item.should_not have_received_message(:goodbye).at_most_twice
|
84
84
|
end
|
85
85
|
|
86
86
|
it "should be able to determine if a call was made at least a specified number of times" do
|
@@ -90,22 +90,22 @@ describe "using the rspec extensions" do
|
|
90
90
|
item.goodbye
|
91
91
|
item.goodbye
|
92
92
|
|
93
|
-
item.should
|
94
|
-
item.should_not
|
93
|
+
item.should have_received_message(:hello).at_most(1)
|
94
|
+
item.should_not have_received_message(:goodbye).at_most(1)
|
95
95
|
end
|
96
96
|
context "using the arg matching style" do
|
97
97
|
it "should be able to determing if a call was made using arg matchers" do
|
98
98
|
item = fake
|
99
99
|
item.hello("Yes")
|
100
100
|
|
101
|
-
item.should
|
101
|
+
item.should have_received_message(:hello,arg_match.any)
|
102
102
|
end
|
103
103
|
|
104
104
|
it "should be able to determing if a call was made using a combination of arg matchers and explicit values" do
|
105
105
|
item = fake
|
106
106
|
item.hello("Yes",2)
|
107
107
|
|
108
|
-
item.should
|
108
|
+
item.should have_received_message(:hello,arg_match.regex(/Y/),2)
|
109
109
|
end
|
110
110
|
end
|
111
111
|
context "using class swapping" do
|
@@ -121,7 +121,7 @@ describe "using the rspec extensions" do
|
|
121
121
|
item = fake
|
122
122
|
item.hello("Yes",2)
|
123
123
|
|
124
|
-
item.should
|
124
|
+
item.should have_received_message(:hello,arg_match.regex(/Y/),2)
|
125
125
|
end
|
126
126
|
end
|
127
127
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fakes-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Develop With Passion®
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|