Created
October 10, 2011 03:25
-
-
Save cfcosta/1274572 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'integration_test_helper' | |
module FakeServer | |
def self.received_messages ; @@received_messages ||= [] ; end | |
def receive_data(data) | |
received_messages << data | |
end | |
end | |
describe Stewie::Connection do | |
include EventMachine::MiniTest::Spec | |
it "should connect to the server" do | |
@server = EventMachine.start_server 'localhost', 54312, FakeServer | |
@connection = EventMachine.connect 'localhost', 54312, Stewie::Connection | |
messages = FakeServer.received_messages | |
messages.must_include "USER stewiebot stewiebot stewiebot :StewieBot\r\n" | |
messages.must_include "NICK stewiebot\r\n" | |
messages.must_include "JOIN #stewiebot\r\n" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment