File tree 3 files changed +25
-1
lines changed
lib/cocoapods-core/specification
3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 8
8
9
9
##### Bug Fixes
10
10
11
- * None.
11
+ * Ensure ` test_type ` value is converted to a symbol from consumers of JSON podspecs.
12
+ [ Dimitris Koutsogiorgas] ( https://github.com/dnkoutso )
13
+ [ #504 ] ( https://github.com/CocoaPods/Core/pull/504 )
12
14
13
15
14
16
## 1.6.1 (2019-02-21)
Original file line number Diff line number Diff line change @@ -371,6 +371,19 @@ def _prepare_prefix_header_contents(value)
371
371
end
372
372
end
373
373
374
+ # Converts the test type value from a string to a symbol.
375
+ #
376
+ # @param [String, Symbol] value.
377
+ # The value of the test type attributed as specified by the user.
378
+ #
379
+ # @return [Symbol] the test type as a symbol.
380
+ #
381
+ def _prepare_test_type ( value )
382
+ if value
383
+ value . to_sym
384
+ end
385
+ end
386
+
374
387
# Converts the array of hashes (script phases) where keys are strings into symbols.
375
388
#
376
389
# @param [Array<Hash{String=>String}>] value.
Original file line number Diff line number Diff line change @@ -272,6 +272,15 @@ module Pod
272
272
test_consumer . test_type . should . be == :unit
273
273
end
274
274
275
+ it 'returns the test type as a symbol when consuming JSON specs' do
276
+ @spec . test_spec { }
277
+ test_spec = @spec . test_specs . first
278
+ test_spec . test_type = :unit
279
+ json_spec = @spec . to_json
280
+ test_consumer = Specification ::Consumer . new ( Specification . from_json ( json_spec ) . test_specs . first , :ios )
281
+ test_consumer . test_type . should . be == :unit
282
+ end
283
+
275
284
it 'allows to specify whether the specification requires an app host' do
276
285
@spec . test_spec { }
277
286
test_spec = @spec . test_specs . first
You can’t perform that action at this time.
0 commit comments