diff --git a/test/core/test_library_loading.rb b/test/core/test_library_loading.rb index b36334e3..88eb20ac 100644 --- a/test/core/test_library_loading.rb +++ b/test/core/test_library_loading.rb @@ -11,9 +11,7 @@ def test_naming_convention_for_bundler compilable_paths = Dir.glob('lib/**/*.rb') raise unless compilable_paths.size >= 5 - compilable_paths.each do |path| - data(path, path) - end + data(compilable_paths.to_h { |path| [path, path] }) def test_vm_compilable(path) assert_instance_of(String, RubyVM::InstructionSequence.compile_file(path).to_binary) end diff --git a/test/core/test_ractor_shareable.rb b/test/core/test_ractor_shareable.rb index 167ab16c..52cc7935 100644 --- a/test/core/test_ractor_shareable.rb +++ b/test/core/test_ractor_shareable.rb @@ -43,9 +43,7 @@ def test_instances_are_can_be_shareable const_name_to_value = ULID.constants.to_h { |const_name| [const_name, ULID.const_get(const_name)] } raise unless const_name_to_value.size >= 10 - const_name_to_value.each_pair do |name, value| - data(name.to_s, value) - end + data(const_name_to_value) def test_shareable_constants(const_value) assert_true(Ractor.shareable?(const_value)) diff --git a/test/core/test_ulid_instance.rb b/test/core/test_ulid_instance.rb index 00bf2afb..bc0f10ab 100644 --- a/test/core/test_ulid_instance.rb +++ b/test/core/test_ulid_instance.rb @@ -351,9 +351,7 @@ def test_freeze assert_same(ulid, ulid.freeze) end - ULID_RETURNING_METHODS.each do |method_name| - data("ULID##{method_name}", method_name) - end + data(ULID_RETURNING_METHODS.to_h { |method_name| ["ULID##{method_name}", method_name] }) def test_all_returned_ulids_are_frozen(method_name) assert_true(ULID.sample.public_send(method_name).frozen?) end