From 048b345e1cb4eeb3f94e8a9f067345308840e0d1 Mon Sep 17 00:00:00 2001 From: nex3 Date: Sat, 10 Feb 2007 02:55:55 +0000 Subject: [PATCH] Sass reports illegal operations better. git-svn-id: svn://hamptoncatlin.com/haml/trunk@358 7063305b-7217-0410-af8c-cdc13e5119b9 --- lib/sass/constant/operation.rb | 2 +- test/sass/engine_test.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sass/constant/operation.rb b/lib/sass/constant/operation.rb index 2374f61a..e698eae6 100644 --- a/lib/sass/constant/operation.rb +++ b/lib/sass/constant/operation.rb @@ -22,7 +22,7 @@ module Sass::Constant begin literal1.send(@operator, literal2) rescue NoMethodError => e - raise e unless e.name == @operator + raise e unless e.name.to_s == @operator.to_s raise Sass::SyntaxError.new("Undefined operation: \"#{literal1} #{@operator} #{literal2}\"") end end diff --git a/test/sass/engine_test.rb b/test/sass/engine_test.rb index 24fc9978..1cfda74e 100644 --- a/test/sass/engine_test.rb +++ b/test/sass/engine_test.rb @@ -33,6 +33,7 @@ class SassEngineTest < Test::Unit::TestCase "a\n :b c" => "Illegal Indentation: Only two space characters are allowed as tabulation.", "a\n :b c" => "Illegal Indentation: Only two space characters are allowed as tabulation.", "a\n :b\n !c = 3" => "Constants may only be declared at the root of a document.", +# "!a = b c d" => 'Undefined operation: "b c d"' } def test_basic_render