spec/integration/draft76_spec.rb in em-websocket-0.5.0 vs spec/integration/draft76_spec.rb in em-websocket-0.5.1
- old
+ new
@@ -1,9 +1,8 @@
# encoding: BINARY
require 'helper'
-require 'integration/shared_examples'
describe "WebSocket server draft76" do
include EM::SpecHelper
default_timeout 1
@@ -33,16 +32,10 @@
"Sec-WebSocket-Protocol" => "sample"
},
:body => "8jKS\'y:G*Co,Wxa-"
}
end
-
- def start_server
- EM::WebSocket.run(:host => "0.0.0.0", :port => 12345) { |ws|
- yield ws if block_given?
- }
- end
def start_client
client = EM.connect('0.0.0.0', 12345, FakeWebSocketClient)
client.send_data(format_request(@request))
yield client if block_given?
@@ -176,10 +169,10 @@
it "should handle invalid http requests by raising HandshakeError passed to onerror callback" do
em {
start_server { |server|
server.onerror { |error|
error.should be_an_instance_of EM::WebSocket::HandshakeError
- error.message.should == "Invalid HTTP header: Could not parse data entirely"
+ error.message.should == "Invalid HTTP header: Could not parse data entirely (1 != 29)"
done
}
}
client = EM.connect('0.0.0.0', 12345, FakeWebSocketClient)