Permalink
Browse files

Fix full description generation bug

  • Loading branch information...
1 parent 50df862 commit 810895a093646e0f0303667fb8783a7236d2cabd @dchelimsky dchelimsky committed Oct 2, 2011
Showing with 5 additions and 4 deletions.
  1. +2 −2 lib/rspec/core/metadata.rb
  2. +3 −2 spec/rspec/core/metadata_spec.rb
View
4 lib/rspec/core/metadata.rb
@@ -49,10 +49,10 @@ def described_class_for(m)
end
def full_description_for(m)
- parts = [m[:description]]
+ parts = [m[:description_args]]
while m.has_key?(:example_group)
m = m[:example_group]
- parts.unshift m[:full_description]
+ parts.unshift m[:description_args]
end
build_description_from(*parts.flatten)
end
View
5 spec/rspec/core/metadata_spec.rb
@@ -306,12 +306,13 @@ module Core
it "concats nested example group descriptions" do
parent = Metadata.new
- parent.process(Object, 'parent')
+ parent.process('parent')
child = Metadata.new(parent)
child.process('child')
- child[:example_group][:full_description].should eq("Object parent child")
+ child[:example_group][:full_description].should eq("parent child")
+ child.for_example('example', child)[:full_description].should eq("parent child example")
end
%w[# . ::].each do |char|

0 comments on commit 810895a

Please sign in to comment.