Skip to content

Instantly share code, notes, and snippets.

@cfcosta
Created October 10, 2011 03:25
Show Gist options
  • Save cfcosta/1274572 to your computer and use it in GitHub Desktop.
Save cfcosta/1274572 to your computer and use it in GitHub Desktop.
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