-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HTML-41 Don't print the output of variable assigns to the IO
- Loading branch information
1 parent
83a7a87
commit 5ca4669
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require "../spec_helper" | ||
|
||
module ToHtml::InstanceTemplate::VariableAssignsSpec | ||
class MyView | ||
def something_expensive | ||
["expensive", "strings"] | ||
end | ||
|
||
ToHtml.instance_template do | ||
tmp = something_expensive | ||
tmp.each do |item| | ||
div { item } | ||
end | ||
end | ||
end | ||
|
||
describe "MyView#to_html" do | ||
it "should not render the variable assignment" do | ||
expected = <<-HTML.squish | ||
<div>expensive</div> | ||
<div>strings</div> | ||
HTML | ||
|
||
MyView.new.to_html.should eq(expected) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters