From c72a42279919eb01d335ceb9e01eb3a1e0c385c7 Mon Sep 17 00:00:00 2001 From: packagethief Date: Tue, 12 Sep 2006 15:34:30 +0000 Subject: [PATCH] Fixed that the tests weren't really working git-svn-id: svn://hamptoncatlin.com/haml/trunk@38 7063305b-7217-0410-af8c-cdc13e5119b9 --- lib/haml/engine.rb | 2 +- test/engine_test.rb | 4 +++- test/results/helpers.xhtml | 1 - test/results/list.xhtml | 11 +++++++++++ test/results/original_engine.xhtml | 7 +------ test/templates/helpers.haml | 1 - test/templates/list.haml | 11 +++++++++++ test/templates/original_engine.haml | 17 ++++------------- 8 files changed, 31 insertions(+), 23 deletions(-) create mode 100644 test/results/list.xhtml create mode 100644 test/templates/list.haml diff --git a/lib/haml/engine.rb b/lib/haml/engine.rb index 2c63e2dc..8ba1d7cb 100644 --- a/lib/haml/engine.rb +++ b/lib/haml/engine.rb @@ -130,7 +130,7 @@ module Haml #:nodoc: attributes = parse_class_and_id(attributes.to_s) attributes.merge!(template_eval(attributes_hash)) unless (attributes_hash.nil? || attributes_hash.empty?) - if action == '\/' + if action == '/' atomic_tag(tag_name, attributes) elsif action == '=' || action == '~' value = template_eval(value) diff --git a/test/engine_test.rb b/test/engine_test.rb index 566f4a2c..a53a8178 100644 --- a/test/engine_test.rb +++ b/test/engine_test.rb @@ -26,8 +26,9 @@ class HamlTest < Test::Unit::TestCase end def assert_renders_correctly(name) - load_result(name).scan(/\n/).zip(@base.render(name).scan(/\n/)).each do |pair| + load_result(name).split("\n").zip(@base.render(name).split("\n")).each do |pair| assert_equal(pair.first, pair.last) + #puts pair.inspect end end @@ -48,6 +49,7 @@ class HamlTest < Test::Unit::TestCase assert_renders_correctly("helpers") assert_renders_correctly("whitespace_handling") assert_renders_correctly("original_engine") + assert_renders_correctly("list") end def test_instance_variables diff --git a/test/results/helpers.xhtml b/test/results/helpers.xhtml index d1f0f715..29099e37 100644 --- a/test/results/helpers.xhtml +++ b/test/results/helpers.xhtml @@ -1,2 +1 @@ &&&&&&&&&&& -Hello nextline diff --git a/test/results/list.xhtml b/test/results/list.xhtml new file mode 100644 index 00000000..26b85ac2 --- /dev/null +++ b/test/results/list.xhtml @@ -0,0 +1,11 @@ + diff --git a/test/results/original_engine.xhtml b/test/results/original_engine.xhtml index 0ffbc725..118ea014 100644 --- a/test/results/original_engine.xhtml +++ b/test/results/original_engine.xhtml @@ -7,12 +7,7 @@

Lorem ipsum dolor sit amet, consectetur adipisicing elit

- -

Cigarettes!

+

Cigarettes!

Man alive!