diff options
author | Eric Wong <e@80x24.org> | 2016-06-06 05:00:11 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-06-06 05:00:11 +0000 |
commit | 133523706715b6e95d2bf410886560f21a23b1e8 (patch) | |
tree | 64784f3e72c166fe05f5fe43a544fccaf8688191 /test | |
parent | 9f00d864e25e35ae6cb223b66a434965b14dbdca (diff) | |
download | yahns-133523706715b6e95d2bf410886560f21a23b1e8.tar.gz |
We can retrieve it when we actually need to create the temporary file. This saves an ivar slot and method dispatch parameters. This patch is nice, unfortunately the patch which follows is not :P
Diffstat (limited to 'test')
-rw-r--r-- | test/test_wbuf.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/test_wbuf.rb b/test/test_wbuf.rb index 990ad9d..1382086 100644 --- a/test/test_wbuf.rb +++ b/test/test_wbuf.rb @@ -9,6 +9,9 @@ class TestWbuf < Testcase class KgioUS < UNIXSocket include Kgio::SocketMethods + def self.output_buffer_tmpdir + Dir.tmpdir + end end def socketpair @@ -20,7 +23,7 @@ class TestWbuf < Testcase buf = "*" * (16384 * 2) nr = 1000 [ true, false ].each do |persist| - wbuf = Yahns::Wbuf.new([], persist, Dir.tmpdir) + wbuf = Yahns::Wbuf.new([], persist) assert_equal false, wbuf.busy a, b = socketpair assert_nil wbuf.wbuf_write(a, "HIHI") @@ -71,7 +74,7 @@ class TestWbuf < Testcase break end while true end - wbuf = Yahns::Wbuf.new([], true, Dir.tmpdir) + wbuf = Yahns::Wbuf.new([], true) rv1 = wbuf.wbuf_write(a, buf) rv2 = wbuf.wbuf_flush(a) @@ -104,7 +107,7 @@ class TestWbuf < Testcase def test_wbuf_flush_close pipe = cloexec_pipe persist = true - wbuf = Yahns::Wbuf.new(pipe[0], persist, Dir.tmpdir) + wbuf = Yahns::Wbuf.new(pipe[0], persist) refute wbuf.respond_to?(:close) # we don't want this for HttpResponse body sp = socketpair rv = nil |