Skip to content
Browse files

Added test for when display returns nil (should not blow up - just ou…

…tput nothing)
  • Loading branch information...
1 parent b0ea8c6 commit 7f86e62900f32ea389d714a5a170e23e70ab2909 Mark Evans committed
Showing with 17 additions and 0 deletions.
  1. +17 −0 spec/helpers/block_helpers_spec.rb
View
17 spec/helpers/block_helpers_spec.rb
@@ -264,4 +264,21 @@ def display(body)
end
+ describe "when display returns 'nil'" do
+ it "should output nothing" do
+ module TestHelperModule
+ remove_const(:NilHelper) if defined?(NilHelper)
+ class NilHelper < BlockHelpers::Base
+ def display(body)
+ end
+ end
+ end
+ eval_erb(%(
+ <% nil_helper do %>
+ hello
+ <% end %>
+ )).should match_html("")
+ end
+ end
+
end

0 comments on commit 7f86e62

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