summaryrefslogtreecommitdiff
path: root/vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7/tests/test_kb.rb
diff options
context:
space:
mode:
authorBenjamin Sanders <ben@Benjamins-MacBook-Pro.local>2025-10-11 10:34:24 -0400
committerBenjamin Sanders <ben@Benjamins-MacBook-Pro.local>2025-10-11 10:34:24 -0400
commit5571dc766e2143e39762ff0b47c41d1c2e154f4c (patch)
treef4f124d314a7e76c04484515aa0fd1f2e271a601 /vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7/tests/test_kb.rb
parent359f3309c97fc894b63e0a295c76ab298504d635 (diff)
Vendor bundled gems for deployment
Diffstat (limited to 'vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7/tests/test_kb.rb')
-rw-r--r--vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7/tests/test_kb.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7/tests/test_kb.rb b/vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7/tests/test_kb.rb
new file mode 100644
index 0000000..9c31f5f
--- /dev/null
+++ b/vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7/tests/test_kb.rb
@@ -0,0 +1,28 @@
+require 'em_test_helper'
+
+class TestKeyboardEvents < Test::Unit::TestCase
+
+ module KbHandler
+ include EM::Protocols::LineText2
+ def receive_line d
+ EM::stop if d == "STOP"
+ end
+ end
+
+ # This test doesn't actually do anything useful but is here to
+ # illustrate the usage. If you removed the timer and ran this test
+ # by itself on a console, and then typed into the console, it would
+ # work.
+ # I don't know how to get the test harness to simulate actual keystrokes.
+ # When someone figures that out, then we can make this a real test.
+ #
+ def test_kb
+ omit_if(jruby?)
+ omit_if(!$stdout.tty?) # don't run the test unless it stands a chance of validity.
+ EM.run do
+ EM.open_keyboard KbHandler
+ EM::Timer.new(1) { EM.stop }
+ end
+ end
+
+end