Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

-Get the spec name *after* the spec has run. This allows for the capt…

…ure of dynamically generated example descriptions.
  • Loading branch information...
commit f0f096622f5856af3920c5e6c10fbee509735882 1 parent 305d5da
@justfalter justfalter authored nicksieger committed
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/ci/reporter/rspec.rb
View
8 lib/ci/reporter/rspec.rb
@@ -73,8 +73,7 @@ def example_group_started(example_group)
def example_started(name)
@formatter.example_started(name)
- name = name.description if name.respond_to?(:description)
- spec = TestCase.new name
+ spec = TestCase.new
@suite.testcases << spec
spec.start
end
@@ -87,6 +86,7 @@ def example_failed(name, counter, failure)
end
spec = @suite.testcases.last
spec.finish
+ spec.name = name.respond_to?(:description) ? name.description : "UNKNOWN"
spec.failures << RSpecFailure.new(failure)
end
@@ -94,13 +94,15 @@ def example_passed(name)
@formatter.example_passed(name)
spec = @suite.testcases.last
spec.finish
+ spec.name = name.respond_to?(:description) ? name.description : "UNKNOWN"
end
def example_pending(*args)
@formatter.example_pending(*args)
+ name = args[0].respond_to?(:description) ? args[0].description : "UNKNOWN"
spec = @suite.testcases.last
spec.finish
- spec.name = "#{spec.name} (PENDING)"
+ spec.name = "#{name} (PENDING)"
spec.skipped = true
end
Please sign in to comment.
Something went wrong with that request. Please try again.