@@ -217,23 +217,30 @@ module Pod
217
217
s . name = 'Pod'
218
218
s . subspec 'Subspec' do |_sp |
219
219
end
220
+ s . test_spec do |_tsp |
221
+ end
220
222
end
221
223
@subspec = @spec . subspecs . first
224
+ @test_subspec = @spec . test_specs . first
222
225
end
223
226
224
227
it 'returns the root spec' do
225
228
@spec . root . should == @spec
226
229
@subspec . root . should == @spec
230
+ @test_subspec . root . should == @spec
227
231
end
228
232
229
233
it 'returns whether it is a root spec' do
230
234
@spec . root? . should . be . true
231
235
@subspec . root? . should . be . false
236
+ @test_subspec . root? . should . be . false
232
237
end
233
238
234
239
it 'returns whether it is a subspec' do
235
240
@spec . subspec? . should . be . false
236
241
@subspec . subspec? . should . be . true
242
+ @test_subspec . subspec? . should . be . true
243
+ @test_subspec . test_specification? . should . be . true
237
244
end
238
245
end
239
246
@@ -268,11 +275,28 @@ module Pod
268
275
@spec . recursive_subspecs . sort_by ( &:name ) . should == [ @subspec , @subsubspec , @subspec_osx , @subspec_ios ]
269
276
end
270
277
278
+ it 'returns the recursive subspecs including test subspecs' do
279
+ @spec . test_spec { }
280
+ test_spec = @spec . test_specs [ 0 ]
281
+ @spec . recursive_subspecs ( true ) . sort_by ( &:name ) . should == [ @subspec , @subsubspec , @subspec_osx , @subspec_ios , test_spec ]
282
+ end
283
+
271
284
it 'returns a subspec given the absolute name' do
272
285
@spec . subspec_by_name ( 'Pod/Subspec' ) . should == @subspec
273
286
@spec . subspec_by_name ( 'Pod/Subspec/Subsubspec' ) . should == @subsubspec
274
287
end
275
288
289
+ it "doesn't return the test subspec given the Tests name" do
290
+ @spec = Spec . new do |s |
291
+ s . name = 'Pod'
292
+ s . version = '1.0'
293
+ s . dependency 'AFNetworking'
294
+ s . osx . dependency 'MagicalRecord'
295
+ s . test_spec { }
296
+ end
297
+ @spec . subspec_by_name ( 'Pod/Tests' , false ) . should . nil?
298
+ end
299
+
276
300
it 'returns a subspec given the relative name' do
277
301
@subspec . subspec_by_name ( 'Subspec/Subsubspec' ) . should == @subsubspec
278
302
end
@@ -327,12 +351,29 @@ module Pod
327
351
]
328
352
end
329
353
354
+ it 'excludes the test subspec from the subspec dependencies' do
355
+ @spec . test_spec { }
356
+ @spec . subspec_dependencies . sort . should == [
357
+ Dependency . new ( 'Pod/Subspec' , '1.0' ) ,
358
+ Dependency . new ( 'Pod/SubspecOSX' , '1.0' ) ,
359
+ Dependency . new ( 'Pod/SubspeciOS' , '1.0' ) ]
360
+ end
361
+
330
362
it 'returns all the dependencies' do
331
363
@spec . dependencies . sort . should == [
332
364
Dependency . new ( 'AFNetworking' ) ,
333
365
Dependency . new ( 'MagicalRecord' ) ]
334
366
end
335
367
368
+ it 'returns the test spec dependencies' do
369
+ test_spec = @spec . test_spec { |s | s . dependency 'OCMock' }
370
+ test_spec . dependencies . sort . should == [
371
+ Dependency . new ( 'AFNetworking' ) ,
372
+ Dependency . new ( 'MagicalRecord' ) ,
373
+ Dependency . new ( 'OCMock' ) ,
374
+ ]
375
+ end
376
+
336
377
it 'returns the dependencies given the platform' do
337
378
@spec . dependencies ( :ios ) . sort . should == [ Dependency . new ( 'AFNetworking' ) ]
338
379
end
0 commit comments