rspec-mocks 2.0.0.beta.16 → 2.0.0.beta.17
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +8 -2
- data/README.markdown +30 -9
- data/Rakefile +16 -16
- data/VERSION +1 -1
- data/cucumber.yml +1 -1
- data/features/support/env.rb +0 -19
- data/rspec-mocks.gemspec +10 -10
- data/spec/rspec/mocks/multiple_return_value_spec.rb +0 -2
- data/spec/spec_helper.rb +0 -3
- metadata +12 -12
data/Gemfile
CHANGED
@@ -1,9 +1,15 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
1
3
|
gem "rake"
|
2
4
|
gem "jeweler"
|
3
5
|
gem "cucumber"
|
4
|
-
gem "aruba",
|
6
|
+
gem "aruba", ">= 0.2.0"
|
5
7
|
gem "autotest"
|
6
8
|
gem "rspec-mocks", :path => "."
|
7
9
|
gem "rspec-core", :path => "../rspec-core"
|
8
10
|
gem "rspec-expectations", :path => "../rspec-expectations"
|
9
|
-
|
11
|
+
if RUBY_VERSION.to_s =~ /1.9/
|
12
|
+
gem "ruby-debug19"
|
13
|
+
else
|
14
|
+
gem "ruby-debug"
|
15
|
+
end
|
data/README.markdown
CHANGED
@@ -3,22 +3,43 @@
|
|
3
3
|
rspec-mocks provides a test-double framework for rspec including support
|
4
4
|
for method stubs, fakes, and message expectations.
|
5
5
|
|
6
|
-
rspec-mocks is currently in alpha release. While you are welcome to
|
7
|
-
track, fork, explore, etc, we're too early in the process to start fielding
|
8
|
-
pull requests and or issues from outside the core development team, so please
|
9
|
-
don't waste your time until this notice changes.
|
10
|
-
|
11
6
|
## Install
|
12
7
|
|
13
|
-
|
8
|
+
gem install rspec --prerelease
|
14
9
|
|
15
10
|
This will install rspec, rspec-core, rspec-expectations and rspec-mocks.
|
16
11
|
|
12
|
+
## Method Stubs
|
13
|
+
|
14
|
+
describe "consumer" do
|
15
|
+
it "gets stuff from a service" do
|
16
|
+
service = double('service')
|
17
|
+
service.stub(:find) { 'value' }
|
18
|
+
consumer = Consumer.new(service)
|
19
|
+
consumer.consume
|
20
|
+
consumer.aquired_stuff.should eq(['value'])
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
## Message Expectations
|
25
|
+
|
26
|
+
describe "some action" do
|
27
|
+
context "when bad stuff happens" do
|
28
|
+
it "logs the error" do
|
29
|
+
logger = double('logger')
|
30
|
+
doer = Doer.new(logger)
|
31
|
+
logger.should_receive(:log).with('oops')
|
32
|
+
doer.do_something_with(:bad_data)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
17
36
|
|
18
|
-
|
37
|
+
## Contribute
|
38
|
+
|
39
|
+
See [http://github.com/rspec/rspec-dev](http://github.com/rspec/rspec-dev)
|
40
|
+
|
41
|
+
## Also see
|
19
42
|
|
20
43
|
* [http://github.com/rspec/rspec](http://github.com/rspec/rspec)
|
21
44
|
* [http://github.com/rspec/rspec-core](http://github.com/rspec/rspec-core)
|
22
45
|
* [http://github.com/rspec/rspec-expectations](http://github.com/rspec/rspec-expectations)
|
23
|
-
* [http://github.com/rspec/rspec-dev](http://github.com/rspec/rspec-dev)
|
24
|
-
|
data/Rakefile
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
require
|
1
|
+
require 'bundler'
|
2
2
|
Bundler.setup
|
3
3
|
|
4
4
|
require 'rake'
|
5
5
|
require 'rspec/mocks/version'
|
6
|
+
require 'rspec/core/rake_task'
|
7
|
+
require 'cucumber/rake/task'
|
6
8
|
|
7
9
|
begin
|
8
10
|
require 'jeweler'
|
@@ -36,25 +38,23 @@ namespace :gem do
|
|
36
38
|
end
|
37
39
|
end
|
38
40
|
|
39
|
-
|
40
|
-
require 'rspec/core/rake_task'
|
41
|
-
RSpec::Core::RakeTask.new(:spec)
|
41
|
+
RSpec::Core::RakeTask.new(:spec)
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
47
|
-
rescue LoadError
|
48
|
-
puts "RSpec core or one of its dependencies is not installed. Install it with: gem install rspec-meta"
|
43
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
44
|
+
spec.rcov = true
|
45
|
+
spec.rcov_opts = %[--exclude "core,expectations,gems/*,spec/resources,spec/spec,spec/spec_helper.rb,db/*,/Library/Ruby/*,config/*" --text-summary --sort coverage]
|
49
46
|
end
|
50
47
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
48
|
+
class Cucumber::Rake::Task::ForkedCucumberRunner
|
49
|
+
# When cucumber shells out, we still need it to run in the context of our
|
50
|
+
# bundle.
|
51
|
+
def run
|
52
|
+
sh "bundle exec #{RUBY} " + args.join(" ")
|
55
53
|
end
|
56
|
-
|
57
|
-
|
54
|
+
end
|
55
|
+
|
56
|
+
Cucumber::Rake::Task.new do |t|
|
57
|
+
t.cucumber_opts = %w{--format progress}
|
58
58
|
end
|
59
59
|
|
60
60
|
task :clobber do
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.0.beta.
|
1
|
+
2.0.0.beta.17
|
data/cucumber.yml
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
default: --require features --tags ~@wip features
|
1
|
+
default: --require features --tags ~@wip features --format progress
|
2
2
|
wip: --require features --tags @wip:3 --wip features
|
data/features/support/env.rb
CHANGED
@@ -1,21 +1,2 @@
|
|
1
|
-
require 'bundler'
|
2
|
-
Bundler.setup
|
3
|
-
|
4
1
|
require 'aruba'
|
5
2
|
require 'rspec/expectations'
|
6
|
-
|
7
|
-
module ArubaOverrides
|
8
|
-
def detect_ruby_script(cmd)
|
9
|
-
if cmd =~ /^rspec /
|
10
|
-
"bundle exec ../../../rspec-core/bin/#{cmd}"
|
11
|
-
elsif cmd =~ /^ruby /
|
12
|
-
"bundle exec #{cmd}"
|
13
|
-
else
|
14
|
-
super(cmd)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
World(ArubaOverrides)
|
20
|
-
|
21
|
-
|
data/rspec-mocks.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rspec-mocks}
|
8
|
-
s.version = "2.0.0.beta.
|
8
|
+
s.version = "2.0.0.beta.17"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["David Chelimsky", "Chad Humphries"]
|
12
|
-
s.date = %q{2010-07-
|
12
|
+
s.date = %q{2010-07-11}
|
13
13
|
s.description = %q{RSpec's 'test double' framework, with support for stubbing and mocking}
|
14
14
|
s.email = %q{dchelimsky@gmail.com;chad.humphries@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -101,7 +101,7 @@ Gem::Specification.new do |s|
|
|
101
101
|
s.homepage = %q{http://github.com/rspec/mocks}
|
102
102
|
s.post_install_message = %q{**************************************************
|
103
103
|
|
104
|
-
Thank you for installing rspec-mocks-2.0.0.beta.
|
104
|
+
Thank you for installing rspec-mocks-2.0.0.beta.17
|
105
105
|
|
106
106
|
**************************************************
|
107
107
|
}
|
@@ -109,7 +109,7 @@ Gem::Specification.new do |s|
|
|
109
109
|
s.require_paths = ["lib"]
|
110
110
|
s.rubyforge_project = %q{rspec}
|
111
111
|
s.rubygems_version = %q{1.3.7}
|
112
|
-
s.summary = %q{rspec-mocks-2.0.0.beta.
|
112
|
+
s.summary = %q{rspec-mocks-2.0.0.beta.17}
|
113
113
|
s.test_files = [
|
114
114
|
"spec/rspec/mocks/and_yield_spec.rb",
|
115
115
|
"spec/rspec/mocks/any_number_of_times_spec.rb",
|
@@ -162,15 +162,15 @@ Gem::Specification.new do |s|
|
|
162
162
|
s.specification_version = 3
|
163
163
|
|
164
164
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
165
|
-
s.add_development_dependency(%q<rspec-core>, ["= 2.0.0.beta.
|
166
|
-
s.add_development_dependency(%q<rspec-expectations>, ["= 2.0.0.beta.
|
165
|
+
s.add_development_dependency(%q<rspec-core>, ["= 2.0.0.beta.17"])
|
166
|
+
s.add_development_dependency(%q<rspec-expectations>, ["= 2.0.0.beta.17"])
|
167
167
|
else
|
168
|
-
s.add_dependency(%q<rspec-core>, ["= 2.0.0.beta.
|
169
|
-
s.add_dependency(%q<rspec-expectations>, ["= 2.0.0.beta.
|
168
|
+
s.add_dependency(%q<rspec-core>, ["= 2.0.0.beta.17"])
|
169
|
+
s.add_dependency(%q<rspec-expectations>, ["= 2.0.0.beta.17"])
|
170
170
|
end
|
171
171
|
else
|
172
|
-
s.add_dependency(%q<rspec-core>, ["= 2.0.0.beta.
|
173
|
-
s.add_dependency(%q<rspec-expectations>, ["= 2.0.0.beta.
|
172
|
+
s.add_dependency(%q<rspec-core>, ["= 2.0.0.beta.17"])
|
173
|
+
s.add_dependency(%q<rspec-expectations>, ["= 2.0.0.beta.17"])
|
174
174
|
end
|
175
175
|
end
|
176
176
|
|
@@ -17,7 +17,6 @@ module RSpec
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it "should complain when there are too few calls" do
|
20
|
-
third = Object.new
|
21
20
|
@mock.message.should == @return_values[0]
|
22
21
|
@mock.message.should == @return_values[1]
|
23
22
|
expect { @mock.rspec_verify }.to raise_error(
|
@@ -27,7 +26,6 @@ module RSpec
|
|
27
26
|
end
|
28
27
|
|
29
28
|
it "should complain when there are too many calls" do
|
30
|
-
third = Object.new
|
31
29
|
@mock.message.should == @return_values[0]
|
32
30
|
@mock.message.should == @return_values[1]
|
33
31
|
@mock.message.should == @return_values[2]
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-mocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 62196417
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
9
|
- 0
|
10
10
|
- beta
|
11
|
-
-
|
12
|
-
version: 2.0.0.beta.
|
11
|
+
- 17
|
12
|
+
version: 2.0.0.beta.17
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- David Chelimsky
|
@@ -18,7 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2010-07-
|
21
|
+
date: 2010-07-11 00:00:00 -05:00
|
22
22
|
default_executable:
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
hash:
|
33
|
+
hash: 62196417
|
34
34
|
segments:
|
35
35
|
- 2
|
36
36
|
- 0
|
37
37
|
- 0
|
38
38
|
- beta
|
39
|
-
-
|
40
|
-
version: 2.0.0.beta.
|
39
|
+
- 17
|
40
|
+
version: 2.0.0.beta.17
|
41
41
|
requirement: *id001
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
type: :development
|
@@ -48,14 +48,14 @@ dependencies:
|
|
48
48
|
requirements:
|
49
49
|
- - "="
|
50
50
|
- !ruby/object:Gem::Version
|
51
|
-
hash:
|
51
|
+
hash: 62196417
|
52
52
|
segments:
|
53
53
|
- 2
|
54
54
|
- 0
|
55
55
|
- 0
|
56
56
|
- beta
|
57
|
-
-
|
58
|
-
version: 2.0.0.beta.
|
57
|
+
- 17
|
58
|
+
version: 2.0.0.beta.17
|
59
59
|
requirement: *id002
|
60
60
|
description: RSpec's 'test double' framework, with support for stubbing and mocking
|
61
61
|
email: dchelimsky@gmail.com;chad.humphries@gmail.com
|
@@ -154,7 +154,7 @@ licenses: []
|
|
154
154
|
post_install_message: |
|
155
155
|
**************************************************
|
156
156
|
|
157
|
-
Thank you for installing rspec-mocks-2.0.0.beta.
|
157
|
+
Thank you for installing rspec-mocks-2.0.0.beta.17
|
158
158
|
|
159
159
|
**************************************************
|
160
160
|
|
@@ -188,7 +188,7 @@ rubyforge_project: rspec
|
|
188
188
|
rubygems_version: 1.3.7
|
189
189
|
signing_key:
|
190
190
|
specification_version: 3
|
191
|
-
summary: rspec-mocks-2.0.0.beta.
|
191
|
+
summary: rspec-mocks-2.0.0.beta.17
|
192
192
|
test_files:
|
193
193
|
- spec/rspec/mocks/and_yield_spec.rb
|
194
194
|
- spec/rspec/mocks/any_number_of_times_spec.rb
|