Permalink
Browse files

Add assert_not_match method for coffescript tests

Apparently 1.8.7 does not have the assert_not_match method (instead
it has assert_no_match).  Add it to the coffescript tests so they
pass.
  • Loading branch information...
1 parent 10a8ffa commit f677cb7e46ffaf7f34f6fb594860594bdc99804d Simon Chiang committed Mar 9, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 test/tilt_coffeescripttemplate_test.rb
@@ -5,6 +5,17 @@
require 'coffee_script'
class CoffeeScriptTemplateTest < Test::Unit::TestCase
+
+ unless method_defined?(:assert_not_match)
+ # assert_not_match is missing on 1.8.7, which uses assert_no_match
+ def assert_not_match(a, b)
+ unless a.kind_of?(Regexp)
+ a = Regexp.new(Regexp.escape(a))
+ end
+ assert_no_match(a,b)
+ end
+ end
+
test "is registered for '.coffee' files" do
assert_equal Tilt::CoffeeScriptTemplate, Tilt['test.coffee']
end

0 comments on commit f677cb7

Please sign in to comment.