Skip to content
Browse files

Render empty table tag

  • Loading branch information...
1 parent aa04bf5 commit 35aa2ef947b828205f4faccb205ec9ac04ea46e7 Joe Fiorini committed Jan 15, 2010
Showing with 9 additions and 1 deletion.
  1. +5 −1 lib/totally_tabular/html_helper.rb
  2. +4 −0 spec/lib/totally_tabular/html_helper_spec.rb
View
6 lib/totally_tabular/html_helper.rb
@@ -2,7 +2,11 @@ module TotallyTabular
class HtmlHelper
def tag(tag)
- ""
+ if tag.to_s.empty?
+ ""
+ else
+ "<table></table>"
+ end
end
end
end
View
4 spec/lib/totally_tabular/html_helper_spec.rb
@@ -16,4 +16,8 @@
it "returns empty string" do
@helper.tag("").should be_empty
end
+
+ it "returns an empty table tag" do
+ @helper.tag(:table).should == "<table></table>"
+ end
end

0 comments on commit 35aa2ef

Please sign in to comment.
Something went wrong with that request. Please try again.