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'))