rspec-subject-extensions 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -8,7 +8,7 @@ a single example that specifies the expected value of each attribute of the subj
|
|
8
8
|
The [Cucumber features](http://relishapp.com/ZenCocoon/rspec-subject-extensions)
|
9
9
|
are the most comprehensive and up-to-date docs for end-users.
|
10
10
|
|
11
|
-
The [RDoc](http://rubydoc.info/gems/rspec-subject-extensions/0.2.
|
11
|
+
The [RDoc](http://rubydoc.info/gems/rspec-subject-extensions/0.2.1/frames) provides
|
12
12
|
additional information for contributors and/or extenders.
|
13
13
|
|
14
14
|
All of the documentation is open source and a work in progress. If you find it
|
@@ -22,7 +22,7 @@ module RSpecSubjectExtensions
|
|
22
22
|
#
|
23
23
|
# # ... generates the same runtime structure as this:
|
24
24
|
# describe Object do
|
25
|
-
# describe "each item"
|
25
|
+
# describe "each item" do
|
26
26
|
# it "should be an Interger" do
|
27
27
|
# subject.items.each do |item|
|
28
28
|
# item.should be_an(Integer)
|
@@ -39,7 +39,7 @@ module RSpecSubjectExtensions
|
|
39
39
|
subject.send(attribute).each do |item|
|
40
40
|
self.class.class_eval do
|
41
41
|
define_method(:subject) do
|
42
|
-
@_subject
|
42
|
+
@_subject = item
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
@@ -8,16 +8,34 @@ module RSpecSubjectExtensions::ClassMethods
|
|
8
8
|
end
|
9
9
|
|
10
10
|
describe "#each" do
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
it "should satisfy expectation" do
|
12
|
+
group = RSpec::Core::ExampleGroup.describe("object") do
|
13
|
+
subject {
|
14
|
+
Class.new do
|
15
|
+
def items
|
16
|
+
[1, 2]
|
17
|
+
end
|
18
|
+
end.new
|
19
|
+
}
|
20
|
+
|
21
|
+
each(:item) { should be_an(Integer) }
|
18
22
|
end
|
23
|
+
group.run(NullObject.new).should be_true
|
24
|
+
end
|
19
25
|
|
20
|
-
|
26
|
+
it "fails when expectation should fail" do
|
27
|
+
group = RSpec::Core::ExampleGroup.describe("object") do
|
28
|
+
subject {
|
29
|
+
Class.new do
|
30
|
+
def items
|
31
|
+
[1, 'a']
|
32
|
+
end
|
33
|
+
end.new
|
34
|
+
}
|
35
|
+
|
36
|
+
each(:item) { should be_an(Integer) }
|
37
|
+
end
|
38
|
+
group.run(NullObject.new).should be_false
|
21
39
|
end
|
22
40
|
|
23
41
|
context "when it doesn't respond to the pluralized version of the attribute" do
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,238 +1,167 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-subject-extensions
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 0
|
10
|
-
version: 0.2.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
13
|
-
-
|
7
|
+
authors:
|
8
|
+
- Sébastien Grosjean
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-10-04 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: rspec
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70139514500340 !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
18
|
+
requirements:
|
27
19
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 23
|
30
|
-
segments:
|
31
|
-
- 2
|
32
|
-
- 6
|
33
|
-
- 0
|
20
|
+
- !ruby/object:Gem::Version
|
34
21
|
version: 2.6.0
|
35
22
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: i18n
|
39
23
|
prerelease: false
|
40
|
-
|
24
|
+
version_requirements: *70139514500340
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: i18n
|
27
|
+
requirement: &70139514499840 !ruby/object:Gem::Requirement
|
41
28
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 11
|
46
|
-
segments:
|
47
|
-
- 0
|
48
|
-
- 5
|
49
|
-
- 0
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
50
32
|
version: 0.5.0
|
51
33
|
type: :runtime
|
52
|
-
version_requirements: *id002
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: activesupport
|
55
34
|
prerelease: false
|
56
|
-
|
35
|
+
version_requirements: *70139514499840
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: activesupport
|
38
|
+
requirement: &70139514499380 !ruby/object:Gem::Requirement
|
57
39
|
none: false
|
58
|
-
requirements:
|
59
|
-
- -
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
segments:
|
63
|
-
- 3
|
64
|
-
- 0
|
65
|
-
version: "3.0"
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '3.0'
|
66
44
|
type: :runtime
|
67
|
-
version_requirements: *id003
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
name: rake
|
70
45
|
prerelease: false
|
71
|
-
|
46
|
+
version_requirements: *70139514499380
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rake
|
49
|
+
requirement: &70139514498920 !ruby/object:Gem::Requirement
|
72
50
|
none: false
|
73
|
-
requirements:
|
51
|
+
requirements:
|
74
52
|
- - ~>
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
77
|
-
segments:
|
78
|
-
- 0
|
79
|
-
- 9
|
80
|
-
version: "0.9"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.9'
|
81
55
|
type: :development
|
82
|
-
version_requirements: *id004
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: cucumber
|
85
56
|
prerelease: false
|
86
|
-
|
57
|
+
version_requirements: *70139514498920
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: cucumber
|
60
|
+
requirement: &70139509861020 !ruby/object:Gem::Requirement
|
87
61
|
none: false
|
88
|
-
requirements:
|
89
|
-
- -
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
hash: 23
|
92
|
-
segments:
|
93
|
-
- 1
|
94
|
-
- 0
|
95
|
-
- 0
|
62
|
+
requirements:
|
63
|
+
- - =
|
64
|
+
- !ruby/object:Gem::Version
|
96
65
|
version: 1.0.0
|
97
66
|
type: :development
|
98
|
-
version_requirements: *id005
|
99
|
-
- !ruby/object:Gem::Dependency
|
100
|
-
name: aruba
|
101
67
|
prerelease: false
|
102
|
-
|
68
|
+
version_requirements: *70139509861020
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: aruba
|
71
|
+
requirement: &70139509860560 !ruby/object:Gem::Requirement
|
103
72
|
none: false
|
104
|
-
requirements:
|
105
|
-
- -
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
hash: 11
|
108
|
-
segments:
|
109
|
-
- 0
|
110
|
-
- 4
|
111
|
-
- 2
|
73
|
+
requirements:
|
74
|
+
- - =
|
75
|
+
- !ruby/object:Gem::Version
|
112
76
|
version: 0.4.2
|
113
77
|
type: :development
|
114
|
-
version_requirements: *id006
|
115
|
-
- !ruby/object:Gem::Dependency
|
116
|
-
name: nokogiri
|
117
78
|
prerelease: false
|
118
|
-
|
79
|
+
version_requirements: *70139509860560
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: nokogiri
|
82
|
+
requirement: &70139509860100 !ruby/object:Gem::Requirement
|
119
83
|
none: false
|
120
|
-
requirements:
|
121
|
-
- -
|
122
|
-
- !ruby/object:Gem::Version
|
123
|
-
hash: 15
|
124
|
-
segments:
|
125
|
-
- 1
|
126
|
-
- 4
|
127
|
-
- 4
|
84
|
+
requirements:
|
85
|
+
- - =
|
86
|
+
- !ruby/object:Gem::Version
|
128
87
|
version: 1.4.4
|
129
88
|
type: :development
|
130
|
-
version_requirements: *id007
|
131
|
-
- !ruby/object:Gem::Dependency
|
132
|
-
name: relish
|
133
89
|
prerelease: false
|
134
|
-
|
90
|
+
version_requirements: *70139509860100
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: relish
|
93
|
+
requirement: &70139509859640 !ruby/object:Gem::Requirement
|
135
94
|
none: false
|
136
|
-
requirements:
|
137
|
-
- -
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
hash: 15
|
140
|
-
segments:
|
141
|
-
- 0
|
142
|
-
- 4
|
143
|
-
- 0
|
95
|
+
requirements:
|
96
|
+
- - =
|
97
|
+
- !ruby/object:Gem::Version
|
144
98
|
version: 0.4.0
|
145
99
|
type: :development
|
146
|
-
version_requirements: *id008
|
147
|
-
- !ruby/object:Gem::Dependency
|
148
|
-
name: yard
|
149
100
|
prerelease: false
|
150
|
-
|
101
|
+
version_requirements: *70139509859640
|
102
|
+
- !ruby/object:Gem::Dependency
|
103
|
+
name: yard
|
104
|
+
requirement: &70139509859180 !ruby/object:Gem::Requirement
|
151
105
|
none: false
|
152
|
-
requirements:
|
106
|
+
requirements:
|
153
107
|
- - ~>
|
154
|
-
- !ruby/object:Gem::Version
|
155
|
-
hash: 7
|
156
|
-
segments:
|
157
|
-
- 0
|
158
|
-
- 7
|
159
|
-
- 2
|
108
|
+
- !ruby/object:Gem::Version
|
160
109
|
version: 0.7.2
|
161
110
|
type: :development
|
162
|
-
version_requirements: *id009
|
163
|
-
- !ruby/object:Gem::Dependency
|
164
|
-
name: guard-rspec
|
165
111
|
prerelease: false
|
166
|
-
|
112
|
+
version_requirements: *70139509859180
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: guard-rspec
|
115
|
+
requirement: &70139509858720 !ruby/object:Gem::Requirement
|
167
116
|
none: false
|
168
|
-
requirements:
|
169
|
-
- -
|
170
|
-
- !ruby/object:Gem::Version
|
171
|
-
hash: 9
|
172
|
-
segments:
|
173
|
-
- 0
|
174
|
-
- 1
|
175
|
-
- 9
|
117
|
+
requirements:
|
118
|
+
- - =
|
119
|
+
- !ruby/object:Gem::Version
|
176
120
|
version: 0.1.9
|
177
121
|
type: :development
|
178
|
-
version_requirements: *id010
|
179
|
-
- !ruby/object:Gem::Dependency
|
180
|
-
name: guard-cucumber
|
181
122
|
prerelease: false
|
182
|
-
|
123
|
+
version_requirements: *70139509858720
|
124
|
+
- !ruby/object:Gem::Dependency
|
125
|
+
name: guard-cucumber
|
126
|
+
requirement: &70139509858260 !ruby/object:Gem::Requirement
|
183
127
|
none: false
|
184
|
-
requirements:
|
128
|
+
requirements:
|
185
129
|
- - ~>
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
hash: 9
|
188
|
-
segments:
|
189
|
-
- 0
|
190
|
-
- 5
|
191
|
-
- 1
|
130
|
+
- !ruby/object:Gem::Version
|
192
131
|
version: 0.5.1
|
193
132
|
type: :development
|
194
|
-
version_requirements: *id011
|
195
|
-
- !ruby/object:Gem::Dependency
|
196
|
-
name: growl
|
197
133
|
prerelease: false
|
198
|
-
|
134
|
+
version_requirements: *70139509858260
|
135
|
+
- !ruby/object:Gem::Dependency
|
136
|
+
name: growl
|
137
|
+
requirement: &70139509857800 !ruby/object:Gem::Requirement
|
199
138
|
none: false
|
200
|
-
requirements:
|
201
|
-
- -
|
202
|
-
- !ruby/object:Gem::Version
|
203
|
-
hash: 17
|
204
|
-
segments:
|
205
|
-
- 1
|
206
|
-
- 0
|
207
|
-
- 3
|
139
|
+
requirements:
|
140
|
+
- - =
|
141
|
+
- !ruby/object:Gem::Version
|
208
142
|
version: 1.0.3
|
209
143
|
type: :development
|
210
|
-
version_requirements: *id012
|
211
|
-
- !ruby/object:Gem::Dependency
|
212
|
-
name: appraisal
|
213
144
|
prerelease: false
|
214
|
-
|
145
|
+
version_requirements: *70139509857800
|
146
|
+
- !ruby/object:Gem::Dependency
|
147
|
+
name: appraisal
|
148
|
+
requirement: &70139509857340 !ruby/object:Gem::Requirement
|
215
149
|
none: false
|
216
|
-
requirements:
|
150
|
+
requirements:
|
217
151
|
- - ~>
|
218
|
-
- !ruby/object:Gem::Version
|
219
|
-
hash: 29
|
220
|
-
segments:
|
221
|
-
- 0
|
222
|
-
- 3
|
223
|
-
- 7
|
152
|
+
- !ruby/object:Gem::Version
|
224
153
|
version: 0.3.7
|
225
154
|
type: :development
|
226
|
-
|
227
|
-
|
155
|
+
prerelease: false
|
156
|
+
version_requirements: *70139509857340
|
157
|
+
description: rspec-subject-extensions let's you use short-hands to generate nested
|
158
|
+
examples groups
|
228
159
|
email: public@zencocoon.com
|
229
160
|
executables: []
|
230
|
-
|
231
161
|
extensions: []
|
232
|
-
|
233
|
-
extra_rdoc_files:
|
162
|
+
extra_rdoc_files:
|
234
163
|
- README.md
|
235
|
-
files:
|
164
|
+
files:
|
236
165
|
- lib/rspec-subject-extensions.rb
|
237
166
|
- lib/rspec-subject-extensions/class_methods.rb
|
238
167
|
- lib/rspec-subject-extensions/version.rb
|
@@ -242,41 +171,32 @@ files:
|
|
242
171
|
- features/support/env.rb
|
243
172
|
- spec/rspec-subject-extensions/class_methods_spec.rb
|
244
173
|
- spec/spec_helper.rb
|
245
|
-
has_rdoc: true
|
246
174
|
homepage: http://github.com/ZenCocoon/rspec-subject-extensions
|
247
175
|
licenses: []
|
248
|
-
|
249
176
|
post_install_message:
|
250
|
-
rdoc_options:
|
177
|
+
rdoc_options:
|
251
178
|
- --charset=UTF-8
|
252
|
-
require_paths:
|
179
|
+
require_paths:
|
253
180
|
- lib
|
254
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
181
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
255
182
|
none: false
|
256
|
-
requirements:
|
257
|
-
- -
|
258
|
-
- !ruby/object:Gem::Version
|
259
|
-
|
260
|
-
|
261
|
-
- 0
|
262
|
-
version: "0"
|
263
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - ! '>='
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '0'
|
187
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
264
188
|
none: false
|
265
|
-
requirements:
|
266
|
-
- -
|
267
|
-
- !ruby/object:Gem::Version
|
268
|
-
|
269
|
-
segments:
|
270
|
-
- 0
|
271
|
-
version: "0"
|
189
|
+
requirements:
|
190
|
+
- - ! '>='
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0'
|
272
193
|
requirements: []
|
273
|
-
|
274
194
|
rubyforge_project:
|
275
|
-
rubygems_version: 1.
|
195
|
+
rubygems_version: 1.8.10
|
276
196
|
signing_key:
|
277
197
|
specification_version: 3
|
278
|
-
summary: rspec-subject-extensions-0.2.
|
279
|
-
test_files:
|
198
|
+
summary: rspec-subject-extensions-0.2.1
|
199
|
+
test_files:
|
280
200
|
- features/README.md
|
281
201
|
- features/class_methods/each_attribute_of_subject.feature
|
282
202
|
- features/support/env.rb
|