lib/cucumber/pro.rb in cucumber-pro-0.0.4 vs lib/cucumber/pro.rb in cucumber-pro-0.0.6
- old
+ new
@@ -1,16 +1,16 @@
require 'logger'
require 'cucumber/pro/formatter'
-require 'cucumber/pro/web_socket_session'
+require 'cucumber/pro/web_socket/session'
require 'cucumber/pro/version'
module Cucumber
module Pro
class << self
- def new(*)
- session = WebSocketSession.new(url, config.logger)
+ def new(runtime, output, options)
+ session = WebSocket::Session.new(url, logger(output))
Formatter.new(session)
end
def configure
yield config
@@ -24,19 +24,22 @@
def url
token = config.token || raise(Error::MissingToken.new)
config.url + "?token=#{token}"
end
+
+ def logger(output)
+ config.logger || Logger.new(output)
+ end
end
class Config
attr_accessor :url, :logger, :token
end
# Default config
configure do |config|
config.url = 'wss://results.cucumber.pro/ws'
- config.logger = Logger.new(ENV['cucumber_pro_log_path'] || STDOUT)
config.token = ENV['CUCUMBER_PRO_TOKEN']
end
module Error
AccessDenied = Class.new(StandardError) {