Permalink
Browse files

Fixed minor coffeescript test failures.

  • Loading branch information...
1 parent e13a336 commit 9f9d0c7b77bc67d88e8b69bc0c06488464215e0f @hannesg hannesg committed Jan 8, 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 9f9d0c7

Please sign in to comment.