about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-06-06 05:00:11 +0000
committerEric Wong <e@80x24.org>2016-06-06 05:00:11 +0000
commit133523706715b6e95d2bf410886560f21a23b1e8 (patch)
tree64784f3e72c166fe05f5fe43a544fccaf8688191 /test
parent9f00d864e25e35ae6cb223b66a434965b14dbdca (diff)
downloadyahns-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.rb9
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