rspec-mocks 2.0.0.a9 → 2.0.0.a10

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -4,3 +4,4 @@ coverage
4
4
  rdoc
5
5
  pkg
6
6
  doc
7
+ *.gemspec
data/Rakefile CHANGED
@@ -51,6 +51,8 @@ end
51
51
 
52
52
  task :clobber do
53
53
  rm_rf 'pkg'
54
+ rm_rf 'tmp'
55
+ rm_rf 'coverage'
54
56
  end
55
57
 
56
58
  task :default => [:check_dependencies, :spec]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0.a9
1
+ 2.0.0.a10
@@ -249,6 +249,7 @@ module Rspec
249
249
  end
250
250
 
251
251
  def with(*args, &block)
252
+ @return_block = block if block_given?
252
253
  @args_expectation = ArgumentExpectation.new(args, &block)
253
254
  self
254
255
  end
@@ -1 +1,2 @@
1
- require 'rspec/mocks'
1
+ # For backward compatibility with rspec-1
2
+ require 'rspec/mocks'
@@ -0,0 +1,45 @@
1
+ require "spec_helper"
2
+
3
+ describe "a double declaration with a block handed to:" do
4
+ describe "should_receive" do
5
+ it "returns the value of executing the block" do
6
+ obj = Object.new
7
+ obj.should_receive(:foo) { 'bar' }
8
+ obj.foo.should eq('bar')
9
+ end
10
+ end
11
+
12
+ describe "stub" do
13
+ it "returns the value of executing the block" do
14
+ obj = Object.new
15
+ obj.stub(:foo) { 'bar' }
16
+ obj.foo.should eq('bar')
17
+ end
18
+ end
19
+
20
+ describe "with" do
21
+ it "returns the value of executing the block" do
22
+ obj = Object.new
23
+ obj.stub(:foo).with('baz') { 'bar' }
24
+ obj.foo('baz').should eq('bar')
25
+ end
26
+ end
27
+
28
+ %w[once twice any_number_of_times ordered and_return].each do |method|
29
+ describe method do
30
+ it "returns the value of executing the block" do
31
+ obj = Object.new
32
+ obj.stub(:foo).send(method) { 'bar' }
33
+ obj.foo.should eq('bar')
34
+ end
35
+ end
36
+ end
37
+
38
+ describe "times" do
39
+ it "returns the value of executing the block" do
40
+ obj = Object.new
41
+ obj.stub(:foo).at_least(1).times { 'bar' }
42
+ obj.foo('baz').should eq('bar')
43
+ end
44
+ end
45
+ end
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-mocks
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.a9
4
+ prerelease: true
5
+ segments:
6
+ - 2
7
+ - 0
8
+ - 0
9
+ - a10
10
+ version: 2.0.0.a10
5
11
  platform: ruby
6
12
  authors:
7
13
  - David Chelimsky
@@ -10,59 +16,75 @@ autorequire:
10
16
  bindir: bin
11
17
  cert_chain: []
12
18
 
13
- date: 2010-02-25 00:00:00 -06:00
19
+ date: 2010-02-27 00:00:00 -06:00
14
20
  default_executable:
15
21
  dependencies:
16
22
  - !ruby/object:Gem::Dependency
17
23
  name: rspec-core
18
- type: :development
19
- version_requirement:
20
- version_requirements: !ruby/object:Gem::Requirement
24
+ prerelease: false
25
+ requirement: &id001 !ruby/object:Gem::Requirement
21
26
  requirements:
22
27
  - - ">="
23
28
  - !ruby/object:Gem::Version
24
- version: 2.0.0.a9
25
- version:
29
+ segments:
30
+ - 2
31
+ - 0
32
+ - 0
33
+ - a10
34
+ version: 2.0.0.a10
35
+ type: :development
36
+ version_requirements: *id001
26
37
  - !ruby/object:Gem::Dependency
27
38
  name: rspec-expectations
28
- type: :development
29
- version_requirement:
30
- version_requirements: !ruby/object:Gem::Requirement
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
31
41
  requirements:
32
42
  - - ">="
33
43
  - !ruby/object:Gem::Version
34
- version: 2.0.0.a9
35
- version:
44
+ segments:
45
+ - 2
46
+ - 0
47
+ - 0
48
+ - a10
49
+ version: 2.0.0.a10
50
+ type: :development
51
+ version_requirements: *id002
36
52
  - !ruby/object:Gem::Dependency
37
53
  name: mocha
38
- type: :development
39
- version_requirement:
40
- version_requirements: !ruby/object:Gem::Requirement
54
+ prerelease: false
55
+ requirement: &id003 !ruby/object:Gem::Requirement
41
56
  requirements:
42
57
  - - ">="
43
58
  - !ruby/object:Gem::Version
59
+ segments:
60
+ - 0
44
61
  version: "0"
45
- version:
62
+ type: :development
63
+ version_requirements: *id003
46
64
  - !ruby/object:Gem::Dependency
47
65
  name: flexmock
48
- type: :development
49
- version_requirement:
50
- version_requirements: !ruby/object:Gem::Requirement
66
+ prerelease: false
67
+ requirement: &id004 !ruby/object:Gem::Requirement
51
68
  requirements:
52
69
  - - ">="
53
70
  - !ruby/object:Gem::Version
71
+ segments:
72
+ - 0
54
73
  version: "0"
55
- version:
74
+ type: :development
75
+ version_requirements: *id004
56
76
  - !ruby/object:Gem::Dependency
57
77
  name: rr
58
- type: :development
59
- version_requirement:
60
- version_requirements: !ruby/object:Gem::Requirement
78
+ prerelease: false
79
+ requirement: &id005 !ruby/object:Gem::Requirement
61
80
  requirements:
62
81
  - - ">="
63
82
  - !ruby/object:Gem::Version
83
+ segments:
84
+ - 0
64
85
  version: "0"
65
- version:
86
+ type: :development
87
+ version_requirements: *id005
66
88
  description: Rspec's 'test double' framework, with support for stubbing and mocking
67
89
  email: dchelimsky@gmail.com;chad.humphries@gmail.com
68
90
  executables: []
@@ -96,12 +118,12 @@ files:
96
118
  - lib/rspec/mocks/spec_methods.rb
97
119
  - lib/rspec/mocks/version.rb
98
120
  - lib/spec/mocks.rb
99
- - rspec-mocks.gemspec
100
121
  - spec/rspec/mocks/and_yield_spec.rb
101
122
  - spec/rspec/mocks/any_number_of_times_spec.rb
102
123
  - spec/rspec/mocks/argument_expectation_spec.rb
103
124
  - spec/rspec/mocks/at_least_spec.rb
104
125
  - spec/rspec/mocks/at_most_spec.rb
126
+ - spec/rspec/mocks/block_return_value_spec.rb
105
127
  - spec/rspec/mocks/bug_report_10260_spec.rb
106
128
  - spec/rspec/mocks/bug_report_10263_spec.rb
107
129
  - spec/rspec/mocks/bug_report_11545_spec.rb
@@ -144,9 +166,9 @@ licenses: []
144
166
  post_install_message: |
145
167
  **************************************************
146
168
 
147
- Thank you for installing rspec-mocks-2.0.0.a9
169
+ Thank you for installing rspec-mocks-2.0.0.a10
148
170
 
149
- The 'a' in 2.0.0.a9 means this is alpha software.
171
+ The 'a' in 2.0.0.a10 means this is alpha software.
150
172
  If you are looking for a supported production release,
151
173
  please "gem install rspec" (without --pre).
152
174
 
@@ -160,27 +182,32 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
182
  requirements:
161
183
  - - ">="
162
184
  - !ruby/object:Gem::Version
185
+ segments:
186
+ - 0
163
187
  version: "0"
164
- version:
165
188
  required_rubygems_version: !ruby/object:Gem::Requirement
166
189
  requirements:
167
190
  - - ">"
168
191
  - !ruby/object:Gem::Version
192
+ segments:
193
+ - 1
194
+ - 3
195
+ - 1
169
196
  version: 1.3.1
170
- version:
171
197
  requirements: []
172
198
 
173
199
  rubyforge_project: rspec
174
- rubygems_version: 1.3.5
200
+ rubygems_version: 1.3.6
175
201
  signing_key:
176
202
  specification_version: 3
177
- summary: rspec-mocks-2.0.0.a9
203
+ summary: rspec-mocks-2.0.0.a10
178
204
  test_files:
179
205
  - spec/rspec/mocks/and_yield_spec.rb
180
206
  - spec/rspec/mocks/any_number_of_times_spec.rb
181
207
  - spec/rspec/mocks/argument_expectation_spec.rb
182
208
  - spec/rspec/mocks/at_least_spec.rb
183
209
  - spec/rspec/mocks/at_most_spec.rb
210
+ - spec/rspec/mocks/block_return_value_spec.rb
184
211
  - spec/rspec/mocks/bug_report_10260_spec.rb
185
212
  - spec/rspec/mocks/bug_report_10263_spec.rb
186
213
  - spec/rspec/mocks/bug_report_11545_spec.rb
@@ -1,169 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{rspec-mocks}
8
- s.version = "2.0.0.a9"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["David Chelimsky", "Chad Humphries"]
12
- s.date = %q{2010-02-25}
13
- s.description = %q{Rspec's 'test double' framework, with support for stubbing and mocking}
14
- s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
15
- s.extra_rdoc_files = [
16
- "README.markdown"
17
- ]
18
- s.files = [
19
- ".document",
20
- ".gitignore",
21
- "License.txt",
22
- "README.markdown",
23
- "Rakefile",
24
- "VERSION",
25
- "lib/rspec/mocks.rb",
26
- "lib/rspec/mocks/argument_expectation.rb",
27
- "lib/rspec/mocks/argument_matchers.rb",
28
- "lib/rspec/mocks/error_generator.rb",
29
- "lib/rspec/mocks/errors.rb",
30
- "lib/rspec/mocks/extensions.rb",
31
- "lib/rspec/mocks/extensions/instance_exec.rb",
32
- "lib/rspec/mocks/extensions/object.rb",
33
- "lib/rspec/mocks/framework.rb",
34
- "lib/rspec/mocks/message_expectation.rb",
35
- "lib/rspec/mocks/methods.rb",
36
- "lib/rspec/mocks/mock.rb",
37
- "lib/rspec/mocks/order_group.rb",
38
- "lib/rspec/mocks/proxy.rb",
39
- "lib/rspec/mocks/space.rb",
40
- "lib/rspec/mocks/spec_methods.rb",
41
- "lib/rspec/mocks/version.rb",
42
- "lib/spec/mocks.rb",
43
- "rspec-mocks.gemspec",
44
- "spec/rspec/mocks/and_yield_spec.rb",
45
- "spec/rspec/mocks/any_number_of_times_spec.rb",
46
- "spec/rspec/mocks/argument_expectation_spec.rb",
47
- "spec/rspec/mocks/at_least_spec.rb",
48
- "spec/rspec/mocks/at_most_spec.rb",
49
- "spec/rspec/mocks/bug_report_10260_spec.rb",
50
- "spec/rspec/mocks/bug_report_10263_spec.rb",
51
- "spec/rspec/mocks/bug_report_11545_spec.rb",
52
- "spec/rspec/mocks/bug_report_15719_spec.rb",
53
- "spec/rspec/mocks/bug_report_496_spec.rb",
54
- "spec/rspec/mocks/bug_report_600_spec.rb",
55
- "spec/rspec/mocks/bug_report_7611_spec.rb",
56
- "spec/rspec/mocks/bug_report_7805_spec.rb",
57
- "spec/rspec/mocks/bug_report_8165_spec.rb",
58
- "spec/rspec/mocks/bug_report_8302_spec.rb",
59
- "spec/rspec/mocks/bug_report_830_spec.rb",
60
- "spec/rspec/mocks/bug_report_957_spec.rb",
61
- "spec/rspec/mocks/failing_argument_matchers_spec.rb",
62
- "spec/rspec/mocks/hash_including_matcher_spec.rb",
63
- "spec/rspec/mocks/hash_not_including_matcher_spec.rb",
64
- "spec/rspec/mocks/mock_ordering_spec.rb",
65
- "spec/rspec/mocks/mock_space_spec.rb",
66
- "spec/rspec/mocks/mock_spec.rb",
67
- "spec/rspec/mocks/multiple_return_value_spec.rb",
68
- "spec/rspec/mocks/nil_expectation_warning_spec.rb",
69
- "spec/rspec/mocks/null_object_mock_spec.rb",
70
- "spec/rspec/mocks/once_counts_spec.rb",
71
- "spec/rspec/mocks/options_hash_spec.rb",
72
- "spec/rspec/mocks/partial_mock_spec.rb",
73
- "spec/rspec/mocks/partial_mock_using_mocks_directly_spec.rb",
74
- "spec/rspec/mocks/passing_argument_matchers_spec.rb",
75
- "spec/rspec/mocks/precise_counts_spec.rb",
76
- "spec/rspec/mocks/record_messages_spec.rb",
77
- "spec/rspec/mocks/stub_chain_spec.rb",
78
- "spec/rspec/mocks/stub_implementation_spec.rb",
79
- "spec/rspec/mocks/stub_spec.rb",
80
- "spec/rspec/mocks/stubbed_message_expectations_spec.rb",
81
- "spec/rspec/mocks/twice_counts_spec.rb",
82
- "spec/spec_helper.rb",
83
- "spec/support/macros.rb"
84
- ]
85
- s.homepage = %q{http://github.com/rspec/mocks}
86
- s.post_install_message = %q{**************************************************
87
-
88
- Thank you for installing rspec-mocks-2.0.0.a9
89
-
90
- The 'a' in 2.0.0.a9 means this is alpha software.
91
- If you are looking for a supported production release,
92
- please "gem install rspec" (without --pre).
93
-
94
- **************************************************
95
- }
96
- s.rdoc_options = ["--charset=UTF-8"]
97
- s.require_paths = ["lib"]
98
- s.rubyforge_project = %q{rspec}
99
- s.rubygems_version = %q{1.3.5}
100
- s.summary = %q{rspec-mocks-2.0.0.a9}
101
- s.test_files = [
102
- "spec/rspec/mocks/and_yield_spec.rb",
103
- "spec/rspec/mocks/any_number_of_times_spec.rb",
104
- "spec/rspec/mocks/argument_expectation_spec.rb",
105
- "spec/rspec/mocks/at_least_spec.rb",
106
- "spec/rspec/mocks/at_most_spec.rb",
107
- "spec/rspec/mocks/bug_report_10260_spec.rb",
108
- "spec/rspec/mocks/bug_report_10263_spec.rb",
109
- "spec/rspec/mocks/bug_report_11545_spec.rb",
110
- "spec/rspec/mocks/bug_report_15719_spec.rb",
111
- "spec/rspec/mocks/bug_report_496_spec.rb",
112
- "spec/rspec/mocks/bug_report_600_spec.rb",
113
- "spec/rspec/mocks/bug_report_7611_spec.rb",
114
- "spec/rspec/mocks/bug_report_7805_spec.rb",
115
- "spec/rspec/mocks/bug_report_8165_spec.rb",
116
- "spec/rspec/mocks/bug_report_8302_spec.rb",
117
- "spec/rspec/mocks/bug_report_830_spec.rb",
118
- "spec/rspec/mocks/bug_report_957_spec.rb",
119
- "spec/rspec/mocks/failing_argument_matchers_spec.rb",
120
- "spec/rspec/mocks/hash_including_matcher_spec.rb",
121
- "spec/rspec/mocks/hash_not_including_matcher_spec.rb",
122
- "spec/rspec/mocks/mock_ordering_spec.rb",
123
- "spec/rspec/mocks/mock_space_spec.rb",
124
- "spec/rspec/mocks/mock_spec.rb",
125
- "spec/rspec/mocks/multiple_return_value_spec.rb",
126
- "spec/rspec/mocks/nil_expectation_warning_spec.rb",
127
- "spec/rspec/mocks/null_object_mock_spec.rb",
128
- "spec/rspec/mocks/once_counts_spec.rb",
129
- "spec/rspec/mocks/options_hash_spec.rb",
130
- "spec/rspec/mocks/partial_mock_spec.rb",
131
- "spec/rspec/mocks/partial_mock_using_mocks_directly_spec.rb",
132
- "spec/rspec/mocks/passing_argument_matchers_spec.rb",
133
- "spec/rspec/mocks/precise_counts_spec.rb",
134
- "spec/rspec/mocks/record_messages_spec.rb",
135
- "spec/rspec/mocks/stub_chain_spec.rb",
136
- "spec/rspec/mocks/stub_implementation_spec.rb",
137
- "spec/rspec/mocks/stub_spec.rb",
138
- "spec/rspec/mocks/stubbed_message_expectations_spec.rb",
139
- "spec/rspec/mocks/twice_counts_spec.rb",
140
- "spec/spec_helper.rb",
141
- "spec/support/macros.rb"
142
- ]
143
-
144
- if s.respond_to? :specification_version then
145
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
146
- s.specification_version = 3
147
-
148
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
149
- s.add_development_dependency(%q<rspec-core>, [">= 2.0.0.a9"])
150
- s.add_development_dependency(%q<rspec-expectations>, [">= 2.0.0.a9"])
151
- s.add_development_dependency(%q<mocha>, [">= 0"])
152
- s.add_development_dependency(%q<flexmock>, [">= 0"])
153
- s.add_development_dependency(%q<rr>, [">= 0"])
154
- else
155
- s.add_dependency(%q<rspec-core>, [">= 2.0.0.a9"])
156
- s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.a9"])
157
- s.add_dependency(%q<mocha>, [">= 0"])
158
- s.add_dependency(%q<flexmock>, [">= 0"])
159
- s.add_dependency(%q<rr>, [">= 0"])
160
- end
161
- else
162
- s.add_dependency(%q<rspec-core>, [">= 2.0.0.a9"])
163
- s.add_dependency(%q<rspec-expectations>, [">= 2.0.0.a9"])
164
- s.add_dependency(%q<mocha>, [">= 0"])
165
- s.add_dependency(%q<flexmock>, [">= 0"])
166
- s.add_dependency(%q<rr>, [">= 0"])
167
- end
168
- end
169
-