about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <bofh@yhbt.net>2020-08-10 22:21:50 +0000
committerEric Wong <bofh@yhbt.net>2020-08-10 22:21:50 +0000
commit24ea2b29600f6c2e2a7180eb58b5256f961b7c3f (patch)
treebd8ca35023f35ced60a4aab3e20705fced359b5f /test
parent6e8728da2b4a98efdd90409acc7c27d305a1010b (diff)
downloadclogger-24ea2b29600f6c2e2a7180eb58b5256f961b7c3f.tar.gz
It's always been supported (since it's just an eval), but make
it explicit.  We'll also drop the Actor.current example since
both Rubinius and Revactor seem dead and Ractor (Guild) is
probably coming...
Diffstat (limited to 'test')
-rw-r--r--test/test_clogger.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_clogger.rb b/test/test_clogger.rb
index b7dd4e9..1dee652 100644
--- a/test/test_clogger.rb
+++ b/test/test_clogger.rb
@@ -212,6 +212,22 @@ class TestClogger < Test::Unit::TestCase
     assert_equal "-#{current}-\n", str.string
   end
 
+  def test_fiber
+    begin
+      current = Fiber.current.to_s
+    rescue NameError => e
+      warn "your Ruby does not support fibers #{e}"
+      return
+    end
+    str = StringIO.new
+    app = lambda { |env| [ 302, {}, [] ] }
+    cl = Clogger.new(app,
+                    :logger => str,
+                    :format => "-$e{Fiber.current}-\n")
+    status, headers, body = cl.call(@req)
+    assert_equal "-#{current}-\n", str.string
+  end
+
   def test_pid
     str = StringIO.new
     app = lambda { |env| [ 302, {}, [] ] }