100% RCov.

git-svn-id: svn://hamptoncatlin.com/haml/trunk@352 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
nex3 2007-02-06 05:24:13 +00:00
parent f4209db126
commit cae1979804
1 changed files with 13 additions and 0 deletions

View File

@ -37,12 +37,25 @@ class SassPluginTest < Test::Unit::TestCase
end
def test_exception_handling
File.delete(tempfile_loc('bork'))
Sass::Plugin.update_stylesheets
File.open(tempfile_loc('bork')) do |file|
assert_equal("/*\nSass::SyntaxError: Undefined constant: \"!bork\"\non line 2 of #{File.dirname(__FILE__) + '/templates/bork.sass'}\n\n1: bork\n2: :bork= !bork", file.read.split("\n")[0...6].join("\n"))
end
File.delete(tempfile_loc('bork'))
end
def test_production_exception_handling
Sass.const_set('RAILS_ENV', 'production')
File.delete(tempfile_loc('bork'))
Sass::Plugin.update_stylesheets
assert_equal("/* Internal stylesheet error */", File.read(tempfile_loc('bork')))
File.delete(tempfile_loc('bork'))
Sass::Plugin.const_set('RAILS_ENV', 'testing')
end
def test_controller_process
File.delete(tempfile_loc('basic'))
assert Sass::Plugin.stylesheet_needs_update?('basic')