lib/cucumber/pro/formatter.rb in cucumber-pro-0.0.16 vs lib/cucumber/pro/formatter.rb in cucumber-pro-0.0.17
- old
+ new
@@ -12,13 +12,10 @@
send_header
end
def before_feature(feature)
@path = feature.file # we need this because table_row doens't have a file_colon_line
- if Cucumber::WINDOWS
- @path = @path.gsub(/\\/, '/')
- end
end
def before_step_result(*args)
keyword, step_match, multiline_arg, status, exception, source_indent, background, file_colon_line = *args
path, line = *file_colon_line.split(':')
@@ -66,23 +63,27 @@
})
end
def send_step_result(path, line, status)
@session.send_message({
- path: path,
+ path: forward_slashify(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_message({
- path: path,
+ path: forward_slashify(path),
location: line.to_i,
mime_type: 'application/vnd.cucumber-pro.test-case-result+json',
body: { status: status }
})
+ end
+
+ def forward_slashify(path)
+ Cucumber::WINDOWS ? path.gsub(/\\/, '/') : path
end
def get_build_number
Pro.config.build_number || SecureRandom.hex
end