Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
noteflakes committed Jul 6, 2020
1 parent e0606c7 commit b4f54c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/eg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def eg(hash)
m.instance_variable_set(k, v)
else
block = if v.respond_to?(:to_proc)
proc { |*args| instance_exec(*args, &v) }
proc { |*args, &block| instance_exec { v.(*args, &block) } }
else
proc { v }
end
Expand Down
2 changes: 2 additions & 0 deletions test/test_http_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def self.server_client_mockup
def self.mockup_connection(input, output, output2)
eg(
:read => ->(*args) { input.read(*args) },
:read_loop => ->(*args, &block) { input.read_loop(*args, &block) },
:readpartial => ->(*args) { input.readpartial(*args) },
:<< => ->(*args) { output.write(*args) },
:write => ->(*args) { output.write(*args) },
Expand Down Expand Up @@ -128,6 +129,7 @@ def test_pipelining_client
end

connection << "GET / HTTP/1.1\r\n\r\nGET / HTTP/1.1\r\nFoo: bar\r\n\r\n"
2.times { snooze }
response = connection.readpartial(8192)

expected = <<~HTTP.http_lines
Expand Down

0 comments on commit b4f54c4

Please sign in to comment.