Skip to content

Commit

Permalink
Fix rubocop cop Style/OpenStructUse
Browse files Browse the repository at this point in the history
  • Loading branch information
JonJagger committed Mar 3, 2024
1 parent 09ba89d commit b65323b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion code/capture3_with_timeout.rb
Expand Up @@ -14,7 +14,7 @@ def initialize(context)
def run(command, max_seconds, tgz_in)
result = { timed_out: false }
pid = nil
waiter = OpenStruct.new(value: nil)
waiter = Struct.new(:value).new(nil)
pipes = make_binary_pipes
stdout_reader = threaded('stdout-reader') { pipes[:stdout].in.read }
stderr_reader = threaded('stderr-reader') { pipes[:stderr].in.read }
Expand Down
4 changes: 2 additions & 2 deletions test/client/json_responder_test.rb
Expand Up @@ -92,11 +92,11 @@ def initialize(body)
end

def get(_path, _args)
OpenStruct.new(body: @body)
Struct.new(:body).new(@body)
end

def post(_path, _args)
OpenStruct.new(body: @body)
Struct.new(:body).new(@body)
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/doubles/rack_request_stub.rb
Expand Up @@ -7,7 +7,7 @@ def initialize(env)
end

def body
OpenStruct.new(read: @env[:body])
Struct.new(:read).new(@env[:body])
end

def path_info
Expand Down

0 comments on commit b65323b

Please sign in to comment.