Skip to content

Commit

Permalink
fix picking of nested classes of RSpec::Core::ExampleGroup
Browse files Browse the repository at this point in the history
closes #8649
  • Loading branch information
intale committed Feb 26, 2013
1 parent b4b3082 commit 4d42dfe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/rspec/moci_formatter.rb
Expand Up @@ -31,9 +31,11 @@ def example_failed(example)

def description(example)
example_group = example.example_group
ancestors = example_group.ancestors.select{ |ancestor| ancestor.respond_to?(:description) and !ancestor.eql?(RSpec::Core::ExampleGroup) }

{
:group => example_group.ancestors[-1].description.strip,
:name => "#{example_group.ancestors.reverse[1..-1].map(&:description).join(' ')} #{example.description}".strip
:group => ancestors[-1].description.strip,
:name => "#{ancestors.reverse[1..-1].map(&:description).join(' ')} #{example.description}".strip
}
end

Expand Down

0 comments on commit 4d42dfe

Please sign in to comment.