rspec-spies 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/Gemfile.lock +9 -8
- data/VERSION +1 -1
- data/lib/rspec-spies.rb +17 -21
- data/rspec-spies.gemspec +59 -0
- data/spec/rspec-spies_spec.rb +10 -0
- metadata +58 -87
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
GEM
|
2
|
+
remote: http://rubygems.org/
|
2
3
|
specs:
|
3
|
-
diff-lcs (1.1.
|
4
|
+
diff-lcs (1.1.3)
|
4
5
|
git (1.2.5)
|
5
6
|
jeweler (1.6.4)
|
6
7
|
bundler (~> 1.0)
|
@@ -8,14 +9,14 @@ GEM
|
|
8
9
|
rake
|
9
10
|
rake (0.9.2)
|
10
11
|
rdoc (3.6.1)
|
11
|
-
rspec (2.
|
12
|
-
rspec-core (~> 2.
|
13
|
-
rspec-expectations (~> 2.
|
14
|
-
rspec-mocks (~> 2.
|
15
|
-
rspec-core (2.
|
16
|
-
rspec-expectations (2.
|
12
|
+
rspec (2.8.0)
|
13
|
+
rspec-core (~> 2.8.0)
|
14
|
+
rspec-expectations (~> 2.8.0)
|
15
|
+
rspec-mocks (~> 2.8.0)
|
16
|
+
rspec-core (2.8.0)
|
17
|
+
rspec-expectations (2.8.0)
|
17
18
|
diff-lcs (~> 1.1.2)
|
18
|
-
rspec-mocks (2.
|
19
|
+
rspec-mocks (2.8.0)
|
19
20
|
|
20
21
|
PLATFORMS
|
21
22
|
ruby
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.1.0
|
data/lib/rspec-spies.rb
CHANGED
@@ -10,39 +10,35 @@ RSpec::Mocks::MethodDouble.class_eval do
|
|
10
10
|
__mock_proxy.record_message_received :#{method_name}, *args, &block
|
11
11
|
__mock_proxy.message_received :#{method_name}, *args, &block
|
12
12
|
end
|
13
|
-
|
13
|
+
#{visibility_for_method}
|
14
14
|
EOF
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
require 'rspec/matchers'
|
19
|
-
RSpec::Matchers.
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
actual.received_message?(sym, *@args, &block)
|
24
|
-
end
|
19
|
+
RSpec::Matchers.define :have_received do |sym, args, block|
|
20
|
+
match do |actual|
|
21
|
+
actual.received_message?(sym, *@args, &block)
|
22
|
+
end
|
25
23
|
|
26
24
|
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
failure_message_for_should do |actual|
|
26
|
+
"expected #{actual.inspect} to have received #{sym.inspect} with #{@args.inspect}"
|
27
|
+
end
|
30
28
|
|
31
29
|
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
failure_message_for_should_not do |actual|
|
31
|
+
"expected #{actual.inspect} to not have received #{sym.inspect} with #{@args.inspect}, but did"
|
32
|
+
end
|
35
33
|
|
36
34
|
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
description do
|
36
|
+
"to have received #{sym.inspect} with #{@args.inspect}"
|
37
|
+
end
|
40
38
|
|
41
39
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
end
|
46
|
-
end
|
40
|
+
def with(*args)
|
41
|
+
@args = args
|
42
|
+
self
|
47
43
|
end
|
48
44
|
end
|
data/rspec-spies.gemspec
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "rspec-spies"
|
8
|
+
s.version = "2.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Joshua Nichols"]
|
12
|
+
s.date = "2012-01-31"
|
13
|
+
s.description = "test spies, for rspec"
|
14
|
+
s.email = "josh@technicalpickles.com"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
"Gemfile",
|
22
|
+
"Gemfile.lock",
|
23
|
+
"LICENSE",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"lib/rspec-spies.rb",
|
28
|
+
"rspec-spies.gemspec",
|
29
|
+
"spec/rspec-spies_spec.rb",
|
30
|
+
"spec/spec.opts",
|
31
|
+
"spec/spec_helper.rb"
|
32
|
+
]
|
33
|
+
s.homepage = "http://github.com/technicalpickles/rspec-spies"
|
34
|
+
s.require_paths = ["lib"]
|
35
|
+
s.rubygems_version = "1.8.10"
|
36
|
+
s.summary = "rspec has gone without tests spies. no more!"
|
37
|
+
|
38
|
+
if s.respond_to? :specification_version then
|
39
|
+
s.specification_version = 3
|
40
|
+
|
41
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
42
|
+
s.add_runtime_dependency(%q<rspec>, ["~> 2.0"])
|
43
|
+
s.add_development_dependency(%q<rake>, [">= 0"])
|
44
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
45
|
+
s.add_development_dependency(%q<rdoc>, [">= 0"])
|
46
|
+
else
|
47
|
+
s.add_dependency(%q<rspec>, ["~> 2.0"])
|
48
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
49
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
50
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
51
|
+
end
|
52
|
+
else
|
53
|
+
s.add_dependency(%q<rspec>, ["~> 2.0"])
|
54
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
55
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
56
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
data/spec/rspec-spies_spec.rb
CHANGED
@@ -36,6 +36,16 @@ module Spec
|
|
36
36
|
message.should == "expected \"HI!\" to have received :slice with [5, 3]"
|
37
37
|
end
|
38
38
|
|
39
|
+
it "doesn't show nil for arguments in description" do
|
40
|
+
@object.stub!(:slice)
|
41
|
+
|
42
|
+
@object.slice(3)
|
43
|
+
matcher = have_received(:slice).with(3)
|
44
|
+
messages = matcher.instance_variable_get("@messages")
|
45
|
+
message = messages[:description].call(@object)
|
46
|
+
message.should_not include "nil"
|
47
|
+
end
|
48
|
+
|
39
49
|
it "correctly lists expects arguments for should_not" do
|
40
50
|
@object.stub!(:slice)
|
41
51
|
|
metadata
CHANGED
@@ -1,90 +1,68 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-spies
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.1.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 2
|
8
|
-
- 0
|
9
|
-
- 0
|
10
|
-
version: 2.0.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Joshua Nichols
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
type: :runtime
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
12
|
+
date: 2012-01-31 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: &70331177385760 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
18
|
+
requirements:
|
26
19
|
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
|
30
|
-
- 2
|
31
|
-
- 0
|
32
|
-
version: "2.0"
|
33
|
-
version_requirements: *id001
|
34
|
-
name: rspec
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '2.0'
|
22
|
+
type: :runtime
|
35
23
|
prerelease: false
|
36
|
-
|
37
|
-
|
38
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
|
-
requirements:
|
41
|
-
- - ">="
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
hash: 3
|
44
|
-
segments:
|
45
|
-
- 0
|
46
|
-
version: "0"
|
47
|
-
version_requirements: *id002
|
24
|
+
version_requirements: *70331177385760
|
25
|
+
- !ruby/object:Gem::Dependency
|
48
26
|
name: rake
|
49
|
-
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
type: :development
|
52
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
27
|
+
requirement: &70331177385060 !ruby/object:Gem::Requirement
|
53
28
|
none: false
|
54
|
-
requirements:
|
55
|
-
- -
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
|
58
|
-
segments:
|
59
|
-
- 0
|
60
|
-
version: "0"
|
61
|
-
version_requirements: *id003
|
62
|
-
name: jeweler
|
63
|
-
prerelease: false
|
64
|
-
- !ruby/object:Gem::Dependency
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
65
33
|
type: :development
|
66
|
-
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70331177385060
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: jeweler
|
38
|
+
requirement: &70331177384440 !ruby/object:Gem::Requirement
|
67
39
|
none: false
|
68
|
-
requirements:
|
69
|
-
- -
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70331177384440
|
47
|
+
- !ruby/object:Gem::Dependency
|
76
48
|
name: rdoc
|
49
|
+
requirement: &70331177383920 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
77
56
|
prerelease: false
|
57
|
+
version_requirements: *70331177383920
|
78
58
|
description: test spies, for rspec
|
79
59
|
email: josh@technicalpickles.com
|
80
60
|
executables: []
|
81
|
-
|
82
61
|
extensions: []
|
83
|
-
|
84
|
-
extra_rdoc_files:
|
62
|
+
extra_rdoc_files:
|
85
63
|
- LICENSE
|
86
64
|
- README.rdoc
|
87
|
-
files:
|
65
|
+
files:
|
88
66
|
- .document
|
89
67
|
- Gemfile
|
90
68
|
- Gemfile.lock
|
@@ -93,42 +71,35 @@ files:
|
|
93
71
|
- Rakefile
|
94
72
|
- VERSION
|
95
73
|
- lib/rspec-spies.rb
|
74
|
+
- rspec-spies.gemspec
|
96
75
|
- spec/rspec-spies_spec.rb
|
97
76
|
- spec/spec.opts
|
98
77
|
- spec/spec_helper.rb
|
99
|
-
has_rdoc: true
|
100
78
|
homepage: http://github.com/technicalpickles/rspec-spies
|
101
79
|
licenses: []
|
102
|
-
|
103
80
|
post_install_message:
|
104
81
|
rdoc_options: []
|
105
|
-
|
106
|
-
require_paths:
|
82
|
+
require_paths:
|
107
83
|
- lib
|
108
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
109
85
|
none: false
|
110
|
-
requirements:
|
111
|
-
- -
|
112
|
-
- !ruby/object:Gem::Version
|
113
|
-
|
114
|
-
segments:
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
segments:
|
115
91
|
- 0
|
116
|
-
|
117
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
+
hash: -2045128620934632625
|
93
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
94
|
none: false
|
119
|
-
requirements:
|
120
|
-
- -
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
|
123
|
-
segments:
|
124
|
-
- 0
|
125
|
-
version: "0"
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
126
99
|
requirements: []
|
127
|
-
|
128
100
|
rubyforge_project:
|
129
|
-
rubygems_version: 1.
|
101
|
+
rubygems_version: 1.8.10
|
130
102
|
signing_key:
|
131
103
|
specification_version: 3
|
132
104
|
summary: rspec has gone without tests spies. no more!
|
133
105
|
test_files: []
|
134
|
-
|