sass 3.4.25 → 3.5.0.pre.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/README.md +1 -1
  4. data/Rakefile +13 -157
  5. data/VERSION +1 -1
  6. data/VERSION_DATE +1 -1
  7. data/VERSION_NAME +1 -1
  8. data/lib/sass.rb +3 -10
  9. data/lib/sass/cache_stores/filesystem.rb +1 -1
  10. data/lib/sass/css.rb +2 -3
  11. data/lib/sass/engine.rb +46 -32
  12. data/lib/sass/environment.rb +27 -6
  13. data/lib/sass/error.rb +5 -5
  14. data/lib/sass/exec/base.rb +3 -12
  15. data/lib/sass/features.rb +1 -0
  16. data/lib/sass/importers/filesystem.rb +2 -2
  17. data/lib/sass/plugin.rb +1 -1
  18. data/lib/sass/plugin/compiler.rb +21 -51
  19. data/lib/sass/plugin/configuration.rb +1 -1
  20. data/lib/sass/plugin/rack.rb +3 -3
  21. data/lib/sass/plugin/staleness_checker.rb +3 -3
  22. data/lib/sass/railtie.rb +1 -1
  23. data/lib/sass/script.rb +3 -3
  24. data/lib/sass/script/functions.rb +238 -47
  25. data/lib/sass/script/lexer.rb +8 -6
  26. data/lib/sass/script/parser.rb +76 -75
  27. data/lib/sass/script/tree/funcall.rb +35 -30
  28. data/lib/sass/script/tree/list_literal.rb +23 -8
  29. data/lib/sass/script/tree/map_literal.rb +2 -2
  30. data/lib/sass/script/tree/node.rb +2 -10
  31. data/lib/sass/script/tree/operation.rb +16 -50
  32. data/lib/sass/script/value.rb +2 -0
  33. data/lib/sass/script/value/arg_list.rb +1 -1
  34. data/lib/sass/script/value/base.rb +20 -3
  35. data/lib/sass/script/value/callable.rb +25 -0
  36. data/lib/sass/script/value/color.rb +10 -10
  37. data/lib/sass/script/value/function.rb +19 -0
  38. data/lib/sass/script/value/helpers.rb +16 -7
  39. data/lib/sass/script/value/list.rb +33 -12
  40. data/lib/sass/script/value/map.rb +2 -2
  41. data/lib/sass/script/value/number.rb +3 -3
  42. data/lib/sass/script/value/string.rb +12 -5
  43. data/lib/sass/scss/parser.rb +101 -45
  44. data/lib/sass/scss/rx.rb +5 -11
  45. data/lib/sass/scss/static_parser.rb +0 -7
  46. data/lib/sass/selector.rb +4 -0
  47. data/lib/sass/selector/abstract_sequence.rb +5 -5
  48. data/lib/sass/selector/comma_sequence.rb +3 -15
  49. data/lib/sass/selector/pseudo.rb +4 -0
  50. data/lib/sass/selector/sequence.rb +30 -3
  51. data/lib/sass/selector/simple.rb +13 -7
  52. data/lib/sass/selector/simple_sequence.rb +1 -1
  53. data/lib/sass/shared.rb +3 -5
  54. data/lib/sass/source/map.rb +4 -4
  55. data/lib/sass/source/position.rb +4 -4
  56. data/lib/sass/stack.rb +21 -1
  57. data/lib/sass/tree/charset_node.rb +1 -1
  58. data/lib/sass/tree/comment_node.rb +1 -1
  59. data/lib/sass/tree/node.rb +3 -3
  60. data/lib/sass/tree/prop_node.rb +46 -54
  61. data/lib/sass/tree/rule_node.rb +7 -15
  62. data/lib/sass/tree/visitors/check_nesting.rb +1 -1
  63. data/lib/sass/tree/visitors/convert.rb +2 -3
  64. data/lib/sass/tree/visitors/cssize.rb +1 -10
  65. data/lib/sass/tree/visitors/deep_copy.rb +2 -2
  66. data/lib/sass/tree/visitors/perform.rb +23 -12
  67. data/lib/sass/tree/visitors/set_options.rb +1 -1
  68. data/lib/sass/tree/visitors/to_css.rb +46 -12
  69. data/lib/sass/util.rb +16 -321
  70. data/lib/sass/util/multibyte_string_scanner.rb +127 -131
  71. data/lib/sass/util/normalized_map.rb +1 -8
  72. data/lib/sass/version.rb +2 -2
  73. data/test/sass-spec.yml +1 -1
  74. data/test/sass/compiler_test.rb +4 -14
  75. data/test/sass/conversion_test.rb +113 -162
  76. data/test/sass/css2sass_test.rb +17 -19
  77. data/test/sass/css_variable_test.rb +176 -70
  78. data/test/sass/encoding_test.rb +2 -32
  79. data/test/sass/engine_test.rb +114 -65
  80. data/test/sass/extend_test.rb +37 -51
  81. data/test/sass/functions_test.rb +57 -15
  82. data/test/sass/importer_test.rb +2 -2
  83. data/test/sass/more_templates/more1.sass +10 -10
  84. data/test/sass/more_templates/more_import.sass +2 -2
  85. data/test/sass/plugin_test.rb +9 -12
  86. data/test/sass/script_conversion_test.rb +9 -0
  87. data/test/sass/script_test.rb +38 -48
  88. data/test/sass/scss/css_test.rb +5 -19
  89. data/test/sass/scss/scss_test.rb +58 -39
  90. data/test/sass/source_map_test.rb +26 -28
  91. data/test/sass/templates/_partial.sass +1 -1
  92. data/test/sass/templates/basic.sass +10 -10
  93. data/test/sass/templates/bork1.sass +1 -1
  94. data/test/sass/templates/bork5.sass +1 -1
  95. data/test/sass/templates/compact.sass +10 -10
  96. data/test/sass/templates/complex.sass +187 -187
  97. data/test/sass/templates/compressed.sass +10 -10
  98. data/test/sass/templates/expanded.sass +10 -10
  99. data/test/sass/templates/import.sass +2 -2
  100. data/test/sass/templates/importee.sass +3 -3
  101. data/test/sass/templates/mixins.sass +22 -22
  102. data/test/sass/templates/multiline.sass +4 -4
  103. data/test/sass/templates/nested.sass +13 -13
  104. data/test/sass/templates/parent_ref.sass +12 -12
  105. data/test/sass/templates/script.sass +70 -70
  106. data/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +1 -1
  107. data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +2 -2
  108. data/test/sass/templates/subdir/subdir.sass +3 -3
  109. data/test/sass/templates/units.sass +10 -10
  110. data/test/sass/util/multibyte_string_scanner_test.rb +139 -149
  111. data/test/sass/util_test.rb +0 -36
  112. data/test/test_helper.rb +39 -0
  113. metadata +30 -57
  114. data/extra/sass-spec-ref.sh +0 -32
  115. data/lib/sass/deprecation.rb +0 -55
  116. data/lib/sass/script/css_variable_warning.rb +0 -52
  117. data/lib/sass/util/cross_platform_random.rb +0 -19
  118. data/lib/sass/util/ordered_hash.rb +0 -192
  119. data/test/sass/results/import_charset_1_8.css +0 -5
  120. data/test/sass/templates/import_charset_1_8.sass +0 -6
  121. data/vendor/listen/CHANGELOG.md +0 -1
  122. data/vendor/listen/CONTRIBUTING.md +0 -38
  123. data/vendor/listen/Gemfile +0 -20
  124. data/vendor/listen/Guardfile +0 -8
  125. data/vendor/listen/LICENSE +0 -20
  126. data/vendor/listen/README.md +0 -349
  127. data/vendor/listen/Rakefile +0 -5
  128. data/vendor/listen/Vagrantfile +0 -96
  129. data/vendor/listen/lib/listen.rb +0 -54
  130. data/vendor/listen/lib/listen/adapter.rb +0 -327
  131. data/vendor/listen/lib/listen/adapters/bsd.rb +0 -75
  132. data/vendor/listen/lib/listen/adapters/darwin.rb +0 -48
  133. data/vendor/listen/lib/listen/adapters/linux.rb +0 -81
  134. data/vendor/listen/lib/listen/adapters/polling.rb +0 -58
  135. data/vendor/listen/lib/listen/adapters/windows.rb +0 -91
  136. data/vendor/listen/lib/listen/directory_record.rb +0 -406
  137. data/vendor/listen/lib/listen/listener.rb +0 -323
  138. data/vendor/listen/lib/listen/turnstile.rb +0 -32
  139. data/vendor/listen/lib/listen/version.rb +0 -3
  140. data/vendor/listen/listen.gemspec +0 -28
  141. data/vendor/listen/spec/listen/adapter_spec.rb +0 -149
  142. data/vendor/listen/spec/listen/adapters/bsd_spec.rb +0 -36
  143. data/vendor/listen/spec/listen/adapters/darwin_spec.rb +0 -37
  144. data/vendor/listen/spec/listen/adapters/linux_spec.rb +0 -47
  145. data/vendor/listen/spec/listen/adapters/polling_spec.rb +0 -68
  146. data/vendor/listen/spec/listen/adapters/windows_spec.rb +0 -30
  147. data/vendor/listen/spec/listen/directory_record_spec.rb +0 -1250
  148. data/vendor/listen/spec/listen/listener_spec.rb +0 -258
  149. data/vendor/listen/spec/listen/turnstile_spec.rb +0 -56
  150. data/vendor/listen/spec/listen_spec.rb +0 -67
  151. data/vendor/listen/spec/spec_helper.rb +0 -25
  152. data/vendor/listen/spec/support/adapter_helper.rb +0 -666
  153. data/vendor/listen/spec/support/directory_record_helper.rb +0 -57
  154. data/vendor/listen/spec/support/fixtures_helper.rb +0 -29
  155. data/vendor/listen/spec/support/listeners_helper.rb +0 -179
  156. data/vendor/listen/spec/support/platform_helper.rb +0 -15
@@ -49,26 +49,13 @@ baz {bar: baz}
49
49
  SCSS
50
50
  end
51
51
 
52
- if Sass::Util.ruby1_8?
53
- def test_unicode
54
- assert_parses <<SCSS
55
- @charset "UTF-8";
56
- foo {
57
- bar: föö bâr; }
58
- SCSS
59
- assert_parses <<SCSS
60
- foo {
61
- bar: föö bâr; }
62
- SCSS
63
- end
64
- else
65
- def test_unicode
66
- assert_parses <<SCSS
52
+ def test_unicode
53
+ assert_parses <<SCSS
67
54
  @charset "UTF-8";
68
55
  foo {
69
56
  bar: föö bâr; }
70
57
  SCSS
71
- assert_equal <<CSS, render(<<SCSS)
58
+ assert_equal <<CSS, render(<<SCSS)
72
59
  @charset "UTF-8";
73
60
  foo {
74
61
  bar: föö bâr; }
@@ -76,7 +63,6 @@ CSS
76
63
  foo {
77
64
  bar: föö bâr; }
78
65
  SCSS
79
- end
80
66
  end
81
67
 
82
68
  def test_invisible_comments
@@ -819,10 +805,10 @@ SCSS
819
805
  assert_selector_parses('E > F')
820
806
  assert_selector_parses('E + F')
821
807
  assert_selector_parses('E ~ F')
822
- silence_warnings {assert_selector_parses('E /foo/ F')}
808
+ assert_selector_parses('E /foo/ F')
823
809
  silence_warnings {assert_selector_parses('E! > F')}
824
810
 
825
- silence_warnings {assert_selector_parses('E /ns|foo/ F')}
811
+ assert_selector_parses('E /ns|foo/ F')
826
812
 
827
813
  # From http://dev.w3.org/csswg/css-scoping-1/
828
814
  assert_selector_parses('E:host(s)')
@@ -1015,8 +1015,7 @@ SASS
1015
1015
  end
1016
1016
 
1017
1017
  def test_disallowed_function_names
1018
- Sass::Deprecation.allow_double_warnings do
1019
- assert_warning(<<WARNING) {render(<<SCSS)}
1018
+ assert_warning(<<WARNING) {render(<<SCSS)}
1020
1019
  DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
1021
1020
  Naming a function "calc" is disallowed and will be an error in future versions of Sass.
1022
1021
  This name conflicts with an existing CSS function with special parse rules.
@@ -1024,7 +1023,7 @@ WARNING
1024
1023
  @function calc() {}
1025
1024
  SCSS
1026
1025
 
1027
- assert_warning(<<WARNING) {render(<<SCSS)}
1026
+ assert_warning(<<WARNING) {render(<<SCSS)}
1028
1027
  DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
1029
1028
  Naming a function "-my-calc" is disallowed and will be an error in future versions of Sass.
1030
1029
  This name conflicts with an existing CSS function with special parse rules.
@@ -1032,7 +1031,7 @@ WARNING
1032
1031
  @function -my-calc() {}
1033
1032
  SCSS
1034
1033
 
1035
- assert_warning(<<WARNING) {render(<<SCSS)}
1034
+ assert_warning(<<WARNING) {render(<<SCSS)}
1036
1035
  DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
1037
1036
  Naming a function "element" is disallowed and will be an error in future versions of Sass.
1038
1037
  This name conflicts with an existing CSS function with special parse rules.
@@ -1040,7 +1039,7 @@ WARNING
1040
1039
  @function element() {}
1041
1040
  SCSS
1042
1041
 
1043
- assert_warning(<<WARNING) {render(<<SCSS)}
1042
+ assert_warning(<<WARNING) {render(<<SCSS)}
1044
1043
  DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
1045
1044
  Naming a function "-my-element" is disallowed and will be an error in future versions of Sass.
1046
1045
  This name conflicts with an existing CSS function with special parse rules.
@@ -1048,7 +1047,7 @@ WARNING
1048
1047
  @function -my-element() {}
1049
1048
  SCSS
1050
1049
 
1051
- assert_warning(<<WARNING) {render(<<SCSS)}
1050
+ assert_warning(<<WARNING) {render(<<SCSS)}
1052
1051
  DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
1053
1052
  Naming a function "expression" is disallowed and will be an error in future versions of Sass.
1054
1053
  This name conflicts with an existing CSS function with special parse rules.
@@ -1056,14 +1055,13 @@ WARNING
1056
1055
  @function expression() {}
1057
1056
  SCSS
1058
1057
 
1059
- assert_warning(<<WARNING) {render(<<SCSS)}
1058
+ assert_warning(<<WARNING) {render(<<SCSS)}
1060
1059
  DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
1061
1060
  Naming a function "url" is disallowed and will be an error in future versions of Sass.
1062
1061
  This name conflicts with an existing CSS function with special parse rules.
1063
1062
  WARNING
1064
1063
  @function url() {}
1065
1064
  SCSS
1066
- end
1067
1065
  end
1068
1066
 
1069
1067
  def test_allowed_function_names
@@ -2174,7 +2172,7 @@ SCSS
2174
2172
  end
2175
2173
 
2176
2174
  def test_selector_interpolation_in_reference_combinator
2177
- silence_warnings {assert_equal <<CSS, render(<<SCSS)}
2175
+ assert_equal <<CSS, render(<<SCSS)
2178
2176
  .foo /a/ .bar /b|c/ .baz {
2179
2177
  a: b; }
2180
2178
  CSS
@@ -3389,22 +3387,22 @@ SCSS
3389
3387
  def test_uses_property_exception_with_star_hack
3390
3388
  render <<SCSS
3391
3389
  foo {
3392
- *bar:baz [fail]; }
3390
+ *bar:baz <fail>; }
3393
3391
  SCSS
3394
3392
  assert(false, "Expected syntax error")
3395
3393
  rescue Sass::SyntaxError => e
3396
- assert_equal 'Invalid CSS after " *bar:baz ": expected ";", was "[fail]; }"', e.message
3394
+ assert_equal 'Invalid CSS after " *bar:baz <fail>": expected expression (e.g. 1px, bold), was "; }"', e.message
3397
3395
  assert_equal 2, e.sass_line
3398
3396
  end
3399
3397
 
3400
3398
  def test_uses_property_exception_with_colon_hack
3401
3399
  render <<SCSS
3402
3400
  foo {
3403
- :bar:baz [fail]; }
3401
+ :bar:baz <fail>; }
3404
3402
  SCSS
3405
3403
  assert(false, "Expected syntax error")
3406
3404
  rescue Sass::SyntaxError => e
3407
- assert_equal 'Invalid CSS after " :bar:baz ": expected ";", was "[fail]; }"', e.message
3405
+ assert_equal 'Invalid CSS after " :bar:baz <fail>": expected expression (e.g. 1px, bold), was "; }"', e.message
3408
3406
  assert_equal 2, e.sass_line
3409
3407
  end
3410
3408
 
@@ -3422,22 +3420,22 @@ SCSS
3422
3420
  def test_uses_property_exception_with_space_after_name
3423
3421
  render <<SCSS
3424
3422
  foo {
3425
- bar: baz [fail]; }
3423
+ bar: baz <fail>; }
3426
3424
  SCSS
3427
3425
  assert(false, "Expected syntax error")
3428
3426
  rescue Sass::SyntaxError => e
3429
- assert_equal 'Invalid CSS after " bar: baz ": expected ";", was "[fail]; }"', e.message
3427
+ assert_equal 'Invalid CSS after " bar: baz <fail>": expected expression (e.g. 1px, bold), was "; }"', e.message
3430
3428
  assert_equal 2, e.sass_line
3431
3429
  end
3432
3430
 
3433
3431
  def test_uses_property_exception_with_non_identifier_after_name
3434
3432
  render <<SCSS
3435
3433
  foo {
3436
- bar:1px [fail]; }
3434
+ bar:1px <fail>; }
3437
3435
  SCSS
3438
3436
  assert(false, "Expected syntax error")
3439
3437
  rescue Sass::SyntaxError => e
3440
- assert_equal 'Invalid CSS after " bar:1px ": expected ";", was "[fail]; }"', e.message
3438
+ assert_equal 'Invalid CSS after " bar:1px <fail>": expected expression (e.g. 1px, bold), was "; }"', e.message
3441
3439
  assert_equal 2, e.sass_line
3442
3440
  end
3443
3441
 
@@ -3668,9 +3666,8 @@ SCSS
3668
3666
  # Ensures that the fix for #2031 doesn't hide legitimate warnings.
3669
3667
  def test_interpolation_warning_in_selector_like_property
3670
3668
  assert_warning(<<WARNING) {assert_equal(<<CSS, render(<<SCSS))}
3671
- DEPRECATION WARNING on line 2 of #{filename_for_test :scss}:
3672
- \#{} interpolation near operators will be simplified in a future version of Sass.
3673
- To preserve the current behavior, use quotes:
3669
+ DEPRECATION WARNING on line 2 of #{filename_for_test :scss}: \#{} interpolation near operators will be simplified
3670
+ in a future version of Sass. To preserve the current behavior, use quotes:
3674
3671
 
3675
3672
  unquote("n+1")
3676
3673
 
@@ -3860,19 +3857,7 @@ SCSS
3860
3857
  end
3861
3858
 
3862
3859
  def test_reference_combinator_with_parent_ref
3863
- silence_warnings {assert_equal <<CSS, render(<<SCSS)}
3864
- a /foo/ b {
3865
- c: d; }
3866
- CSS
3867
- a {& /foo/ b {c: d}}
3868
- SCSS
3869
- end
3870
-
3871
- def test_reference_combinator_warning
3872
- assert_warning(<<WARNING) {assert_equal <<CSS, render(<<SCSS)}
3873
- DEPRECATION WARNING on line 1, column 8 of test_reference_combinator_warning_inline.scss:
3874
- The reference combinator /foo/ is deprecated and will be removed in a future release.
3875
- WARNING
3860
+ assert_equal <<CSS, render(<<SCSS)
3876
3861
  a /foo/ b {
3877
3862
  c: d; }
3878
3863
  CSS
@@ -3942,12 +3927,13 @@ a.\#{"foo"} b
3942
3927
  SCSS
3943
3928
  end
3944
3929
 
3945
- def test_extra_comma_in_mixin_arglist_error
3946
- assert_raise_message(Sass::SyntaxError, <<MESSAGE.rstrip) {render <<SCSS}
3947
- Invalid CSS after "...clude foo(bar, ": expected mixin argument, was ");"
3948
- MESSAGE
3949
- @mixin foo($a1, $a2) {
3950
- baz: $a1 $a2;
3930
+ def test_extra_comma_in_mixin_arglist
3931
+ assert_equal <<CSS, render(<<SCSS)
3932
+ .bar {
3933
+ baz: bar; }
3934
+ CSS
3935
+ @mixin foo($a1,) {
3936
+ baz: $a1;
3951
3937
  }
3952
3938
 
3953
3939
  .bar {
@@ -3956,6 +3942,39 @@ MESSAGE
3956
3942
  SCSS
3957
3943
  end
3958
3944
 
3945
+
3946
+ def test_extra_comma_between_parameters_in_mixin_arglist
3947
+ assert_raise_message(Sass::SyntaxError, "Invalid CSS after \"...nclude foo(bar,\": expected \")\", was \", baz );\"") {render <<SCSS}
3948
+ @mixin foo($a1, $a2) {
3949
+ baz: $a1;
3950
+ bef: $a2;
3951
+ }
3952
+
3953
+ .bar {
3954
+ @include foo(bar,, baz );
3955
+ }
3956
+ SCSS
3957
+ end
3958
+
3959
+
3960
+ def test_extra_comma_in_mixin_arglist_ending_needs_have_parentheses_after
3961
+ assert_raise_message(Sass::SyntaxError, "Invalid CSS after \" bri,\": expected \")\", was \"};\"") {render <<SCSS}
3962
+ @mixin foo($a1, $a2) {
3963
+ baz: $a1;
3964
+ bal: $a2;
3965
+ }
3966
+
3967
+ .bar {
3968
+ @include foo(
3969
+ bar,
3970
+ bri,
3971
+ };
3972
+ }
3973
+ SCSS
3974
+ end
3975
+
3976
+
3977
+
3959
3978
  def test_interpolation
3960
3979
  assert_equal <<CSS, render(<<SCSS)
3961
3980
  ul li#foo a span.label {
@@ -37,7 +37,7 @@ JSON
37
37
  end
38
38
 
39
39
  def test_simple_mapping_sass
40
- silence_warnings {assert_parses_with_sourcemap <<SASS, <<CSS, <<JSON, :syntax => :sass}
40
+ assert_parses_with_sourcemap <<SASS, <<CSS, <<JSON, :syntax => :sass
41
41
  a
42
42
  foo: bar
43
43
  /* SOME COMMENT */
@@ -61,7 +61,7 @@ JSON
61
61
  end
62
62
 
63
63
  def test_simple_mapping_with_file_uris
64
- uri = Sass::Util.file_uri_from_path(Sass::Util.absolute_path(filename_for_test(:scss)))
64
+ uri = Sass::Util.file_uri_from_path(File.absolute_path(filename_for_test(:scss)))
65
65
  assert_parses_with_sourcemap <<SCSS, <<CSS, <<JSON, :sourcemap => :file
66
66
  a {
67
67
  foo: bar;
@@ -114,7 +114,7 @@ JSON
114
114
 
115
115
  def test_mapping_with_directory_sass
116
116
  options = {:filename => "sass/style.sass", :output => "css/style.css", :syntax => :sass}
117
- silence_warnings {assert_parses_with_sourcemap <<SASS, <<CSS, <<JSON, options}
117
+ assert_parses_with_sourcemap <<SASS, <<CSS, <<JSON, options
118
118
  a
119
119
  foo: bar
120
120
  /* SOME COMMENT */
@@ -137,9 +137,8 @@ CSS
137
137
  JSON
138
138
  end
139
139
 
140
- unless Sass::Util.ruby1_8?
141
- def test_simple_charset_mapping_scss
142
- assert_parses_with_sourcemap <<SCSS, <<CSS, <<JSON
140
+ def test_simple_charset_mapping_scss
141
+ assert_parses_with_sourcemap <<SCSS, <<CSS, <<JSON
143
142
  a {
144
143
  fóó: bár;
145
144
  }
@@ -158,10 +157,10 @@ CSS
158
157
  "file": "test.css"
159
158
  }
160
159
  JSON
161
- end
160
+ end
162
161
 
163
- def test_simple_charset_mapping_sass
164
- assert_parses_with_sourcemap <<SASS, <<CSS, <<JSON, :syntax => :sass
162
+ def test_simple_charset_mapping_sass
163
+ assert_parses_with_sourcemap <<SASS, <<CSS, <<JSON, :syntax => :sass
165
164
  a
166
165
  fóó: bár
167
166
  SASS
@@ -179,10 +178,10 @@ CSS
179
178
  "file": "test.css"
180
179
  }
181
180
  JSON
182
- end
181
+ end
183
182
 
184
- def test_different_charset_than_encoding_scss
185
- assert_parses_with_sourcemap(<<SCSS.force_encoding("IBM866"), <<CSS, <<JSON)
183
+ def test_different_charset_than_encoding_scss
184
+ assert_parses_with_sourcemap(<<SCSS.force_encoding("IBM866"), <<CSS, <<JSON)
186
185
  @charset "IBM866";
187
186
  f\x86\x86 {
188
187
  \x86: b;
@@ -202,10 +201,10 @@ CSS
202
201
  "file": "test.css"
203
202
  }
204
203
  JSON
205
- end
204
+ end
206
205
 
207
- def test_different_charset_than_encoding_sass
208
- assert_parses_with_sourcemap(<<SASS.force_encoding("IBM866"), <<CSS, <<JSON, :syntax => :sass)
206
+ def test_different_charset_than_encoding_sass
207
+ assert_parses_with_sourcemap(<<SASS.force_encoding("IBM866"), <<CSS, <<JSON, :syntax => :sass)
209
208
  @charset "IBM866"
210
209
  f\x86\x86
211
210
  \x86: b
@@ -224,7 +223,6 @@ CSS
224
223
  "file": "test.css"
225
224
  }
226
225
  JSON
227
- end
228
226
  end
229
227
 
230
228
  def test_import_sourcemap_scss
@@ -362,7 +360,8 @@ $translucent-red: rgba(255, 0, 0, 0.5);
362
360
  }
363
361
  }
364
362
  {{22}}&:active {{/22}}{
365
- {{23}}border{{/23}}: {{24}}$width solid black{{/24}};
363
+ {{23}}color{{/23}}: {{24}}#010203 + #040506{{/24}};
364
+ {{25}}border{{/25}}: {{26}}$width solid black{{/26}};
366
365
  }
367
366
  {{2}}/* SOME COMMENT */{{/2}}
368
367
  {{3}}font{{/3}}: {{4}}2px/3px {{/4}}{
@@ -385,7 +384,8 @@ SCSS
385
384
  {{19}}a .special:after{{/19}} {
386
385
  {{20}}content{{/20}}: {{21}}"I ate 15 pies 2px thick!"{{/21}}; }
387
386
  {{22}}a:active{{/22}} {
388
- {{23}}border{{/23}}: {{24}}2px solid black{{/24}}; }
387
+ {{23}}color{{/23}}: {{24}}#050709{{/24}};
388
+ {{25}}border{{/25}}: {{26}}2px solid black{{/26}}; }
389
389
 
390
390
  /*# sourceMappingURL=test.css.map */
391
391
  CSS
@@ -405,7 +405,8 @@ $translucent-red: rgba(255, 0, 0, 0.5)
405
405
  {{19}}&:after{{/19}}
406
406
  {{20}}content{{/20}}: {{21}}"I ate #{5 + 10} pies #{$width} thick!"{{/21}}
407
407
  {{22}}&:active{{/22}}
408
- {{23}}border{{/23}}: {{24}}$width solid black{{/24}}
408
+ {{23}}color{{/23}}: {{24}}#010203 + #040506{{/24}}
409
+ {{25}}border{{/25}}: {{26}}$width solid black{{/26}}
409
410
 
410
411
  {{2}}/* SOME COMMENT */{{/2}}
411
412
  {{3}}font{{/3}}: {{4}}2px/3px{{/4}}
@@ -426,7 +427,8 @@ SASS
426
427
  {{19}}a .special:after{{/19}} {
427
428
  {{20}}content{{/20}}: {{21}}"I ate 15 pies 2px thick!"{{/21}}; }
428
429
  {{22}}a:active{{/22}} {
429
- {{23}}border{{/23}}: {{24}}2px solid black{{/24}}; }
430
+ {{23}}color{{/23}}: {{24}}#050709{{/24}};
431
+ {{25}}border{{/25}}: {{26}}2px solid black{{/26}}; }
430
432
 
431
433
  /*# sourceMappingURL=test.css.map */
432
434
  CSS
@@ -663,7 +665,7 @@ CSS
663
665
  end
664
666
 
665
667
  def test_mixin_sourcemap_sass
666
- silence_warnings {assert_parses_with_mapping <<'SASS', <<'CSS', :syntax => :sass}
668
+ assert_parses_with_mapping <<'SASS', <<'CSS', :syntax => :sass
667
669
  =large-text
668
670
  :font
669
671
  {{2}}size{{/2}}: {{3}}20px{{/3}}
@@ -757,7 +759,7 @@ CSS
757
759
  # Regression tests
758
760
 
759
761
  def test_properties_sass
760
- silence_warnings {assert_parses_with_mapping <<SASS, <<CSS, :syntax => :sass}
762
+ assert_parses_with_mapping <<SASS, <<CSS, :syntax => :sass
761
763
  {{1}}.foo{{/1}}
762
764
  :{{2}}name{{/2}} {{3}}value{{/3}}
763
765
  {{4}}name{{/4}}: {{5}}value{{/5}}
@@ -796,7 +798,7 @@ SCSS
796
798
 
797
799
  interpolated = engine.to_tree.children.
798
800
  first.children.
799
- first.value.children[1]
801
+ first.value.first.children[1]
800
802
  assert_equal "123", interpolated.to_sass
801
803
  range = interpolated.source_range
802
804
  assert_equal 3, range.start_pos.line
@@ -984,11 +986,7 @@ CSS
984
986
  def assert_ranges_equal(expected, actual, lines, prefix)
985
987
  assert_positions_equal(expected.start_pos, actual.start_pos, lines, prefix + " start position")
986
988
  assert_positions_equal(expected.end_pos, actual.end_pos, lines, prefix + " end position")
987
- if expected.file.nil?
988
- assert_nil(actual.file)
989
- else
990
- assert_equal(expected.file, actual.file)
991
- end
989
+ assert_equal(expected.file, actual.file)
992
990
  end
993
991
 
994
992
  def assert_sourcemaps_equal(source, css, expected, actual)
@@ -1,2 +1,2 @@
1
1
  #foo
2
- background-color: #baf
2
+ :background-color #baf
@@ -1,23 +1,23 @@
1
1
 
2
2
 
3
3
  body
4
- font: Arial
5
- background: blue
4
+ :font Arial
5
+ :background blue
6
6
 
7
7
  #page
8
- width: 700px
9
- height: 100
8
+ :width 700px
9
+ :height 100
10
10
  #header
11
- height: 300px
11
+ :height 300px
12
12
  h1
13
- font-size: 50px
14
- color: blue
13
+ :font-size 50px
14
+ :color blue
15
15
 
16
16
  #content.user.show
17
17
  #container.top
18
18
  #column.left
19
- width: 100px
19
+ :width 100px
20
20
  #column.right
21
- width: 600px
21
+ :width 600px
22
22
  #container.bottom
23
- background: brown
23
+ :background brown