@@ -242,8 +242,9 @@ module Aws
242
242
243
243
describe 'metadata' do
244
244
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
+ )
247
248
end
248
249
249
250
before do
@@ -267,22 +268,23 @@ module Aws
267
268
end
268
269
269
270
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__ ) )
272
273
Partitions . clear
273
274
Partitions . add ( original_json )
274
275
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__ ) )
277
277
)
278
278
end
279
279
end
280
280
281
281
# normal endpoint testing
282
282
describe Partitions ::EndpointProvider do
283
283
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
+
286
288
end
287
289
288
290
before { Partitions . add ( partition_json ) }
@@ -428,8 +430,9 @@ module Aws
428
430
# variants endpoints testing
429
431
describe Partitions ::EndpointProvider do
430
432
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
+ )
433
436
end
434
437
435
438
before do
@@ -438,18 +441,19 @@ module Aws
438
441
end
439
442
440
443
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__ ) )
443
446
Partitions . clear
444
447
Partitions . add ( original_json )
445
448
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
+ )
448
452
)
449
453
end
450
454
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__ ) )
453
457
454
458
describe '.resolve' do
455
459
test_cases . each_with_index do |test_case , index |
@@ -503,6 +507,5 @@ module Aws
503
507
end
504
508
end
505
509
end
506
-
507
510
end
508
511
end
0 commit comments