lib/cucumber/pro/formatter.rb in cucumber-pro-0.0.12 vs lib/cucumber/pro/formatter.rb in cucumber-pro-0.0.13
- old
+ new
@@ -4,12 +4,13 @@
module Cucumber
module Pro
class Formatter
- def initialize(session)
+ def initialize(session, working_copy)
@session = session
+ @working_copy = working_copy
send_header
end
def before_feature(feature)
@path = feature.file # we need this because table_row doens't have a file_colon_line
@@ -51,31 +52,29 @@
end
private
def send_header
- working_copy = Scm::WorkingCopy.detect
- working_copy.check_clean
- @session.send({
- repo_url: working_copy.repo_url,
- branch: working_copy.branch,
- rev: working_copy.rev,
+ @session.send_message({
+ repo_url: @working_copy.repo_url,
+ branch: @working_copy.branch,
+ rev: @working_copy.rev,
group: get_run_id,
info: Info.new.to_h
})
end
def send_step_result(path, line, status)
- @session.send({
+ @session.send_message({
path: path,
location: line.to_i,
mime_type: 'application/vnd.cucumber.test-step-result+json',
body: { status: status }
})
end
def send_test_case_result(path, line, status)
- @session.send({
+ @session.send_message({
path: path,
location: line.to_i,
mime_type: 'application/vnd.cucumber-pro.test-case-result+json',
body: { status: status }
})