Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't add empty groups when a child doesn't exist

  • Loading branch information...
commit cd29d37ed21dcd9e61e41d5458e13da109e5947d 1 parent d6350b9
@arches authored
Showing with 2 additions and 5 deletions.
  1. +1 −1  lib/fingerprinter.rb
  2. +1 −4 spec/fingerprinter_spec.rb
View
2  lib/fingerprinter.rb
@@ -22,7 +22,7 @@ def hash_to_rows(prefix, hash, objects)
# make a group and recurse for the columns we don't handle
groups = create_child_group(prefix, hash, target)
- row.add_children(groups)
+ row.add_children(groups) unless groups.all? {|g| g.children.empty?}
end
rows
View
5 spec/fingerprinter_spec.rb
@@ -47,10 +47,7 @@ class TablePrint::Row
rows.length.should == 1
row = rows.first
- row.children.length.should == 1
-
- group = row.children.first
- group.children.length.should == 0
+ row.children.length.should == 0
end
it "allows a lambda as the display_method" do
Please sign in to comment.
Something went wrong with that request. Please try again.