Skip to content

Commit ac7cb8b

Browse files
committed
1 parent 462d508 commit ac7cb8b

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

ruby/src/application.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def run
6666

6767
# @rbs return: Hash[String, untyped]?
6868
def json_data
69-
File.open(filepath) { |f| JSON.parse(f) }
69+
File.open(filepath) { |f| JSON.parse(f.read) }
7070
end
7171

7272
# @rbs return: Hash[String, untyped]?
@@ -99,7 +99,10 @@ def sort_value(value)
9999

100100
# @rbs return: bool
101101
def test_env?
102-
caller(0..0).first.split('/').last.include?('minitest.rb')
102+
runner = caller(0..0)
103+
return false if runner.nil?
104+
105+
runner.first.split('/').last.include?('minitest.rb')
103106
end
104107

105108
# @rbs message: String

ruby/test/application_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def test_sort_json_data_with_invalid_data_type_of_order
6363
attr_reader :dirname, :filename, :filepath
6464

6565
def actual_json
66-
File.open(filepath) { |f| JSON.parse(f).deep_symbolize_keys }
66+
File.open(filepath) { |f| JSON.parse(f.read).deep_symbolize_keys }
6767
end
6868

6969
def json_data

0 commit comments

Comments
 (0)