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
| describe "opening a socket connection" do | |
| it "should add players to game if available and respond READY" do | |
| EM.run { | |
| server = Server.new(:host => '0.0.0.0', :port => 12345) | |
| server.start | |
| # opens the socket client connection | |
| socket = EM.connect('0.0.0.0', 12345, FakeSocketClient) | |
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
| class FakeSocketClient < EventMachine::Connection | |
| attr_writer :onopen, :onclose, :onmessage | |
| attr_reader :data | |
| def initialize | |
| @state = :new | |
| @data = [] | |
| end |
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
| #! /usr/bin/env ruby | |
| raise "Argument to 'take' not specfied.\n\n\tUsage: take [dump]\n" if ARGV.length == 0 | |
| module Take | |
| class BathroomClosedForCleaningError < RuntimeError; end | |
| end | |
| case ARGV[0].downcase | |
| when 'dump' | |
| remarks = [] |
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
| beforeEach(function() { | |
| this.addMatchers({ | |
| toBeA: function(expected) { return this.env.equals_(this.actual, jasmine.any(expected)); } | |
| }); | |
| }); |
NewerOlder