vendor/plugins/haml/test/sass/engine_test.rb in radiant-0.7.2 vs vendor/plugins/haml/test/sass/engine_test.rb in radiant-0.8.0

- old
+ new

@@ -40,11 +40,11 @@ END "a\n :b c" => "1 space was used for indentation. Sass must be indented using two spaces.", "a\n :b c" => "4 spaces were used for indentation. Sass must be indented using two spaces.", "a\n :b c\n !d = 3" => "Constants may only be declared at the root of a document.", "!a = 1b + 2c" => "Incompatible units: b and c.", - "& a\n :b c" => "Base-level rules cannot contain the parent-selector-referencing character '&'.", + "& a\n :b c" => ["Base-level rules cannot contain the parent-selector-referencing character '&'.", 1], "a\n :b\n c" => "Illegal nesting: Only attributes may be nested beneath attributes.", "a,\n :b c" => "Rules can\'t end in commas.", "a," => "Rules can\'t end in commas.", "a,\n!b = c" => "Rules can\'t end in commas.", "!a = b\n :c d\n" => "Illegal nesting: Nothing may be nested beneath constants.", @@ -58,11 +58,13 @@ "=foo\n :color red\n.bar\n +foo\n :color red" => "Illegal nesting: Nothing may be nested beneath mixin directives.", " a\n b: c" => ["Indenting at the beginning of the document is illegal.", 1], " \n \n\t\n a\n b: c" => ["Indenting at the beginning of the document is illegal.", 4], # Regression tests - "a\n b:\n c\n d" => ["Illegal nesting: Only attributes may be nested beneath attributes.", 3] + "a\n b:\n c\n d" => ["Illegal nesting: Only attributes may be nested beneath attributes.", 3], + "& foo\n bar: baz\n blat: bang" => ["Base-level rules cannot contain the parent-selector-referencing character '&'.", 1], + "a\n b: c\n& foo\n bar: baz\n blat: bang" => ["Base-level rules cannot contain the parent-selector-referencing character '&'.", 3], } def test_basic_render renders_correctly "basic", { :style => :compact } end @@ -168,9 +170,19 @@ assert_equal("Illegal attribute syntax: can't use normal syntax when :attribute_syntax => :alternate is set.", e.message) else assert(false, "SyntaxError not raised for :attribute_syntax => :alternate") end + end + + def test_pseudo_elements + assert_equal(<<CSS, render(<<SASS)) +::first-line { + size: 10em; } +CSS +::first-line + size: 10em +SASS end def test_directive assert_equal("@a b;", render("@a b"))