@@ -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
@@ -273,6 +280,17 @@ module Pod
273
280
@spec . subspec_by_name ( 'Pod/Subspec/Subsubspec' ) . should == @subsubspec
274
281
end
275
282
283
+ it "doesn't return the test subspec given the Tests name" do
284
+ @spec = Spec . new do |s |
285
+ s . name = 'Pod'
286
+ s . version = '1.0'
287
+ s . dependency 'AFNetworking'
288
+ s . osx . dependency 'MagicalRecord'
289
+ s . test_spec { }
290
+ end
291
+ @spec . subspec_by_name ( 'Pod/Tests' , false ) . should . nil?
292
+ end
293
+
276
294
it 'returns a subspec given the relative name' do
277
295
@subspec . subspec_by_name ( 'Subspec/Subsubspec' ) . should == @subsubspec
278
296
end
@@ -327,12 +345,29 @@ module Pod
327
345
]
328
346
end
329
347
348
+ it 'excludes the test subspec from the subspec dependencies' do
349
+ @spec . test_spec { }
350
+ @spec . subspec_dependencies . sort . should == [
351
+ Dependency . new ( 'Pod/Subspec' , '1.0' ) ,
352
+ Dependency . new ( 'Pod/SubspecOSX' , '1.0' ) ,
353
+ Dependency . new ( 'Pod/SubspeciOS' , '1.0' ) ]
354
+ end
355
+
330
356
it 'returns all the dependencies' do
331
357
@spec . dependencies . sort . should == [
332
358
Dependency . new ( 'AFNetworking' ) ,
333
359
Dependency . new ( 'MagicalRecord' ) ]
334
360
end
335
361
362
+ it 'returns the test spec dependencies' do
363
+ test_spec = @spec . test_spec { |s | s . dependency 'OCMock' }
364
+ test_spec . dependencies . sort . should == [
365
+ Dependency . new ( 'AFNetworking' ) ,
366
+ Dependency . new ( 'MagicalRecord' ) ,
367
+ Dependency . new ( 'OCMock' ) ,
368
+ ]
369
+ end
370
+
336
371
it 'returns the dependencies given the platform' do
337
372
@spec . dependencies ( :ios ) . sort . should == [ Dependency . new ( 'AFNetworking' ) ]
338
373
end
0 commit comments