Permalink
Browse files

Merge pull request #124 from hannesg/coffee_script_test_fix

Fixed minor coffeescript test failures.
  • Loading branch information...
2 parents 77dfce2 + 9f9d0c7 commit b9dc4e56384ccd35e188c444913bd79f57a05331 @rtomayko committed Jan 9, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 test/tilt_coffeescripttemplate_test.rb
@@ -23,15 +23,16 @@ class CoffeeScriptTemplateTest < Test::Unit::TestCase
str = "puts 'Hello, World!'\n"
template = Tilt::CoffeeScriptTemplate.new(:bare => true) { str }
- assert_equal "puts('Hello, World!');", template.render
+ assert_equal "\nputs('Hello, World!');\n", template.render
template2 = Tilt::CoffeeScriptTemplate.new(:no_wrap => true) { str}
- assert_equal "puts('Hello, World!');", template.render
+ assert_equal "\nputs('Hello, World!');\n", template.render
end
context "disabling coffee-script wrapper globally" do
setup do
@bare = Tilt::CoffeeScriptTemplate.default_bare
+ Tilt::CoffeeScriptTemplate.default_bare = true
end
teardown do
@@ -40,18 +41,17 @@ class CoffeeScriptTemplateTest < Test::Unit::TestCase
test "no options" do
template = Tilt::CoffeeScriptTemplate.new { |t| "puts 'Hello, World!'\n" }
- assert_match "puts('Hello, World!');", template.render
- assert_match "(function() {", template.render
+ assert_equal "\nputs('Hello, World!');\n", template.render
end
test "overridden by :bare" do
template = Tilt::CoffeeScriptTemplate.new(:bare => false) { "puts 'Hello, World!'\n" }
- assert_not_equal "puts('Hello, World!');", template.render
+ assert_not_equal "\nputs('Hello, World!');\n", template.render
end
test "overridden by :no_wrap" do
template = Tilt::CoffeeScriptTemplate.new(:no_wrap => false) { "puts 'Hello, World!'\n" }
- assert_not_equal "puts('Hello, World!');", template.render
+ assert_not_equal "\nputs('Hello, World!');\n", template.render
end
end
end

0 comments on commit b9dc4e5

Please sign in to comment.