diff --git a/lib/turbo_tests.rb b/lib/turbo_tests.rb index ff1a6f1..d90a04b 100644 --- a/lib/turbo_tests.rb +++ b/lib/turbo_tests.rb @@ -2,7 +2,6 @@ require "open3" require "fileutils" -require "ostruct" require "json" require "rspec" diff --git a/lib/utils/hash_extension.rb b/lib/utils/hash_extension.rb index 16ad7cb..ba7cee6 100644 --- a/lib/utils/hash_extension.rb +++ b/lib/utils/hash_extension.rb @@ -1,9 +1,7 @@ module CoreExtensions refine Hash do def to_struct - OpenStruct.new(self.each_with_object({}) do |(key, val), acc| - acc[key] = val.is_a?(Hash) ? val.to_struct : val - end) + Struct.new(*self.keys).new(*self.values.map { |value| value.is_a?(Hash) ? value.to_struct : value }) end end end