Sha256: df79152d4aa3171d718cb48418a7e7ad2f5371aba1db634d45513a5b395f388f
Contents?: true
Size: 592 Bytes
Versions: 27
Compression:
Stored size: 592 Bytes
Contents
require 'spec_helper' module WebsocketRails class MockWebSocket attr_writer :onmessage, :onerror, :onclose def env env = Rack::MockRequest.env_for('/websocket') end def onmessage(event=nil) @onmessage.call(event) end def onerror(event=nil) @onerror.call(event) end def onclose(event=nil) @onclose.call(event) end def rack_response [ -1, {}, [] ] end def send(*args) true end def trigger(event) true end def id object_id.to_i end end end
Version data entries
27 entries across 27 versions & 3 rubygems