mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Get rid of uses of Haml::Helpers#puts in tests.
This commit is contained in:
parent
9817621ede
commit
b281f151a8
4 changed files with 11 additions and 11 deletions
|
@ -328,11 +328,11 @@ HAML
|
||||||
|
|
||||||
def test_stop_eval
|
def test_stop_eval
|
||||||
assert_equal("", render("= 'Hello'", :suppress_eval => true))
|
assert_equal("", render("= 'Hello'", :suppress_eval => true))
|
||||||
assert_equal("", render("- puts 'foo'", :suppress_eval => true))
|
assert_equal("", render("- haml_concat 'foo'", :suppress_eval => true))
|
||||||
assert_equal("<div id='foo' yes='no' />\n", render("#foo{:yes => 'no'}/", :suppress_eval => true))
|
assert_equal("<div id='foo' yes='no' />\n", render("#foo{:yes => 'no'}/", :suppress_eval => true))
|
||||||
assert_equal("<div id='foo' />\n", render("#foo{:yes => 'no', :call => a_function() }/", :suppress_eval => true))
|
assert_equal("<div id='foo' />\n", render("#foo{:yes => 'no', :call => a_function() }/", :suppress_eval => true))
|
||||||
assert_equal("<div />\n", render("%div[1]/", :suppress_eval => true))
|
assert_equal("<div />\n", render("%div[1]/", :suppress_eval => true))
|
||||||
assert_equal("", render(":ruby\n puts 'hello'", :suppress_eval => true))
|
assert_equal("", render(":ruby\n Kernel.puts 'hello'", :suppress_eval => true))
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_attr_wrapper
|
def test_attr_wrapper
|
||||||
|
|
|
@ -148,7 +148,7 @@ class HelperTest < Test::Unit::TestCase
|
||||||
Haml::Helpers.module_eval do
|
Haml::Helpers.module_eval do
|
||||||
def trc(collection, &block)
|
def trc(collection, &block)
|
||||||
collection.each do |record|
|
collection.each do |record|
|
||||||
puts capture_haml(record, &block)
|
haml_concat capture_haml(record, &block)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -175,7 +175,7 @@ class HelperTest < Test::Unit::TestCase
|
||||||
|
|
||||||
result = context.capture_haml do
|
result = context.capture_haml do
|
||||||
context.haml_tag :p, :attr => "val" do
|
context.haml_tag :p, :attr => "val" do
|
||||||
context.puts "Blah"
|
context.haml_concat "Blah"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
= "not me!"
|
= "not me!"
|
||||||
= "nor me!"
|
= "nor me!"
|
||||||
- puts "not even me!"
|
- haml_concat "not even me!"
|
||||||
%p= "NO!"
|
%p= "NO!"
|
||||||
%p~ "UH-UH!"
|
%p~ "UH-UH!"
|
||||||
%h1 Me!
|
%h1 Me!
|
||||||
|
|
|
@ -52,18 +52,18 @@ click
|
||||||
= list_of({:google => 'http://www.google.com'}) do |name, link|
|
= list_of({:google => 'http://www.google.com'}) do |name, link|
|
||||||
%a{ :href => link }= name
|
%a{ :href => link }= name
|
||||||
%p
|
%p
|
||||||
- puts "foo"
|
- haml_concat "foo"
|
||||||
%div
|
%div
|
||||||
- puts "bar"
|
- haml_concat "bar"
|
||||||
- puts "boom"
|
- haml_concat "boom"
|
||||||
baz
|
baz
|
||||||
- puts "boom, again"
|
- haml_concat "boom, again"
|
||||||
- haml_tag :table do
|
- haml_tag :table do
|
||||||
- haml_tag :tr do
|
- haml_tag :tr do
|
||||||
- haml_tag :td, {:class => 'cell'} do
|
- haml_tag :td, {:class => 'cell'} do
|
||||||
- haml_tag :strong, "strong!"
|
- haml_tag :strong, "strong!"
|
||||||
- puts "data"
|
- haml_concat "data"
|
||||||
- haml_tag :td do
|
- haml_tag :td do
|
||||||
- puts "more_data"
|
- haml_concat "more_data"
|
||||||
- haml_tag :hr
|
- haml_tag :hr
|
||||||
- haml_tag :div, ''
|
- haml_tag :div, ''
|
||||||
|
|
Loading…
Add table
Reference in a new issue