@@ -242,8 +242,9 @@ module Aws
242242
243243 describe 'metadata' do
244244 let ( :partition_metadata_json ) do
245- path = File . expand_path ( '../test_partitions_metadata.json' , __FILE__ )
246- JSON . load ( File . read ( path ) )
245+ JSON . load_file (
246+ File . expand_path ( 'test_partitions_metadata.json' , __dir__ )
247+ )
247248 end
248249
249250 before do
@@ -267,22 +268,23 @@ module Aws
267268 end
268269
269270 after do
270- path = File . expand_path ( '../../partitions.json' , __FILE__ )
271- original_json = JSON . load ( File . read ( path ) )
271+ original_json =
272+ JSON . load_file ( File . expand_path ( '../partitions.json' , __dir__ ) )
272273 Partitions . clear
273274 Partitions . add ( original_json )
274275 Partitions . merge_metadata (
275- JSON . load ( File . read (
276- File . expand_path ( '../../partitions-metadata.json' , __FILE__ ) ) )
276+ JSON . load_file ( File . expand_path ( '../partitions-metadata.json' , __dir__ ) )
277277 )
278278 end
279279 end
280280
281281 # normal endpoint testing
282282 describe Partitions ::EndpointProvider do
283283 let ( :partition_json ) do
284- path = File . expand_path ( '../test_partition.json' , __FILE__ )
285- JSON . load ( File . read ( path ) )
284+ JSON . load_file (
285+ File . expand_path ( 'test_partition.json' , __dir__ )
286+ )
287+
286288 end
287289
288290 before { Partitions . add ( partition_json ) }
@@ -428,8 +430,9 @@ module Aws
428430 # variants endpoints testing
429431 describe Partitions ::EndpointProvider do
430432 let ( :fips_partition_json ) do
431- path = File . expand_path ( '../variant_test_partition.json' , __FILE__ )
432- JSON . load ( File . read ( path ) )
433+ JSON . load_file (
434+ File . expand_path ( 'variant_test_partition.json' , __dir__ )
435+ )
433436 end
434437
435438 before do
@@ -438,18 +441,19 @@ module Aws
438441 end
439442
440443 after do
441- path = File . expand_path ( '../../partitions.json' , __FILE__ )
442- original_json = JSON . load ( File . read ( path ) )
444+ original_json =
445+ JSON . load_file ( File . expand_path ( '../partitions.json' , __dir__ ) )
443446 Partitions . clear
444447 Partitions . add ( original_json )
445448 Partitions . merge_metadata (
446- JSON . load ( File . read (
447- File . expand_path ( '../../partitions-metadata.json' , __FILE__ ) ) )
449+ JSON . load_file (
450+ File . expand_path ( '../partitions-metadata.json' , __dir__ )
451+ )
448452 )
449453 end
450454
451- path = File . expand_path ( '../variant_test_cases.json' , __FILE__ )
452- test_cases = JSON . load ( File . read ( path ) )
455+ test_cases =
456+ JSON . load_file ( File . expand_path ( 'variant_test_cases.json' , __dir__ ) )
453457
454458 describe '.resolve' do
455459 test_cases . each_with_index do |test_case , index |
@@ -503,6 +507,5 @@ module Aws
503507 end
504508 end
505509 end
506-
507510 end
508511end
0 commit comments