test/unit/einhorn/event.rb in einhorn-0.4.7 vs test/unit/einhorn/event.rb in einhorn-0.4.8
- old
+ new
@@ -1,6 +1,6 @@
-require File.expand_path(File.join(File.dirname(__FILE__), '../../test_helper'))
+require File.expand_path(File.join(File.dirname(__FILE__), '../../_lib'))
require 'set'
require 'einhorn'
module Einhorn::Event
@@ -11,21 +11,21 @@
@@writeable = {}
@@timers = {}
end
end
-class EventTest < Test::Unit::TestCase
- context "when running the event loop" do
- setup do
+class EventTest < EinhornTestCase
+ describe "when running the event loop" do
+ before do
Einhorn::Event.reset
end
- teardown do
+ after do
Einhorn::Event.reset
end
- should "select on readable descriptors" do
+ it "selects on readable descriptors" do
sock1 = mock(:fileno => 4)
sock2 = mock(:fileno => 5)
conn1 = Einhorn::Event::Connection.open(sock1)
conn2 = Einhorn::Event::Connection.open(sock2)
@@ -38,11 +38,11 @@
end.returns([[], [], []])
Einhorn::Event.loop_once
end
- should "select on writeable descriptors" do
+ it "selects on writeable descriptors" do
sock1 = mock(:fileno => 4)
sock2 = mock(:fileno => 5)
conn1 = Einhorn::Event::Connection.open(sock1)
conn2 = Einhorn::Event::Connection.open(sock2)
@@ -58,10 +58,10 @@
end.returns([[], [], []])
Einhorn::Event.loop_once
end
- should "run callbacks for ready selectables" do
+ it "runs callbacks for ready selectables" do
sock1 = mock(:fileno => 4)
sock2 = mock(:fileno => 5)
conn1 = Einhorn::Event::Connection.open(sock1)
conn2 = Einhorn::Event::Connection.open(sock2)