From cae19798041bdad7d5325b7cf37af3cf4e0864eb Mon Sep 17 00:00:00 2001 From: nex3 Date: Tue, 6 Feb 2007 05:24:13 +0000 Subject: [PATCH] 100% RCov. git-svn-id: svn://hamptoncatlin.com/haml/trunk@352 7063305b-7217-0410-af8c-cdc13e5119b9 --- test/sass/plugin_test.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/sass/plugin_test.rb b/test/sass/plugin_test.rb index 7a6642fe..3e700cbc 100644 --- a/test/sass/plugin_test.rb +++ b/test/sass/plugin_test.rb @@ -37,11 +37,24 @@ 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'))