test/sass/engine_test.rb in sass-3.3.0.alpha.391 vs test/sass/engine_test.rb in sass-3.3.0.alpha.392
- old
+ new
@@ -1577,11 +1577,11 @@
CSS
$a: 5
@while $a != 0
a-\#{$a}
blooble: gloop
- $a: $a - 1
+ $a: $a - 1 !global
SASS
end
def test_else
assert_equal(<<CSS, render(<<SASS))
@@ -1671,20 +1671,20 @@
assert_equal(<<CSS, render(<<SASS))
a {
b: 1;
c: 2; }
CSS
-$a: 1
a
+ $a: 1
b: $a
$a: 2
c: $a
SASS
end
def test_variable_scope
- assert_equal(<<CSS, render(<<SASS))
+ silence_warnings {assert_equal(<<CSS, render(<<SASS))}
a {
b-1: c;
b-2: c;
d: 12; }
@@ -1706,24 +1706,19 @@
SASS
end
def test_hyphen_underscore_insensitive_variables
assert_equal(<<CSS, render(<<SASS))
-a {
- b: c; }
-
d {
e: 13;
f: foobar; }
CSS
$var-hyphen: 12
$var_under: foo
-a
- $var_hyphen: 1 + $var_hyphen
- $var-under: $var-under + bar
- b: c
+$var_hyphen: 1 + $var_hyphen
+$var-under: $var-under + bar
d
e: $var-hyphen
f: $var_under
SASS
@@ -2484,9 +2479,28 @@
.foo
@media screen
@at-root (without: media)
.bar
a: b
+SASS
+ end
+
+ def test_variable_assignment_with_global
+ assert_no_warning {assert_equal(<<CSS, render(<<SASS))}
+.foo {
+ a: x; }
+
+.bar {
+ b: x; }
+CSS
+$var: 1
+
+.foo
+ $var: x !global
+ a: $var
+
+.bar
+ b: $var
SASS
end
# Regression tests