lib/angelo/rspec/helpers.rb in angelo-0.1.3 vs lib/angelo/rspec/helpers.rb in angelo-0.1.4
- old
+ new
@@ -4,21 +4,21 @@
module RSpec
module Helpers
HTTP_URL = 'http://%s:%d'
- WS_URL = 'ws://%s:%d'
attr_reader :last_response
def define_app &block
before do
app = Class.new Angelo::Base
app.class_eval { content_type :html } # reset
app.class_eval &block
@server = Angelo::Server.new app
+ app.server = @server
$reactor = Reactor.new unless $reactor.alive?
end
after do
sleep 0.1
@@ -79,9 +79,11 @@
include Celluloid::Logger
extend Forwardable
def_delegator :@socket, :write
def_delegators :@driver, :binary, :close, :text
+
+ WS_URL = 'ws://%s:%d'
attr_reader :driver, :socket
attr_writer :addr, :port, :path, :on_close, :on_message, :on_open
def initialize addr, port, path