spec/websocket_spec.rb in em-websocket-0.2.0 vs spec/websocket_spec.rb in em-websocket-0.2.1

- old
+ new

@@ -1,6 +1,6 @@ -require 'spec/helper' +require 'helper' describe EventMachine::WebSocket do it "should automatically complete WebSocket handshake" do EM.run do @@ -151,10 +151,12 @@ http.stream { |msg| } end EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 12345) do |ws| ws.onopen { - ws.request["Path"].should == "/?baz=qux&foo=bar" + path, query = ws.request["Path"].split('?') + path.should == '/' + Hash[*query.split(/&|=/)].should == {"foo"=>"bar", "baz"=>"qux"} ws.request["Query"]["foo"].should == "bar" ws.request["Query"]["baz"].should == "qux" } ws.onclose { ws.state.should == :closed