haml 3.2.0.alpha.10 → 3.2.0.alpha.13
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of haml might be problematic. Click here for more details.
- data/.yardopts +19 -7
- data/CHANGELOG.md +1224 -0
- data/FAQ.md +157 -0
- data/README.md +99 -62
- data/REFERENCE.md +1404 -0
- data/Rakefile +52 -341
- data/init.rb +1 -18
- data/lib/haml.rb +6 -30
- data/lib/haml/buffer.rb +37 -16
- data/lib/haml/compiler.rb +52 -13
- data/lib/haml/engine.rb +61 -44
- data/lib/haml/exec.rb +21 -4
- data/lib/haml/filters.rb +136 -166
- data/lib/haml/helpers.rb +37 -10
- data/lib/haml/helpers/action_view_extensions.rb +2 -1
- data/lib/haml/helpers/action_view_mods.rb +67 -181
- data/lib/haml/helpers/rails_323_textarea_fix.rb +39 -0
- data/lib/haml/helpers/xss_mods.rb +9 -11
- data/lib/haml/html.rb +22 -9
- data/lib/haml/html/erb.rb +1 -1
- data/lib/haml/parser.rb +22 -15
- data/lib/haml/railtie.rb +2 -13
- data/lib/haml/template.rb +18 -85
- data/lib/haml/template/options.rb +1 -1
- data/lib/haml/template/plugin.rb +15 -101
- data/lib/haml/util.rb +120 -603
- data/lib/haml/version.rb +1 -107
- data/test/{haml/engine_test.rb → engine_test.rb} +137 -143
- data/test/{haml/erb → erb}/_av_partial_1.erb +1 -1
- data/test/{haml/erb → erb}/_av_partial_2.erb +1 -1
- data/test/{haml/erb → erb}/action_view.erb +1 -1
- data/test/{haml/erb → erb}/standard.erb +0 -0
- data/test/filters_test.rb +141 -0
- data/test/gemfiles/Gemfile.rails-3.0.x +4 -6
- data/test/gemfiles/Gemfile.rails-3.1.x +5 -6
- data/test/gemfiles/Gemfile.rails-3.2.x +6 -0
- data/test/haml-spec/LICENSE +14 -0
- data/test/{haml/spec → haml-spec}/README.md +26 -17
- data/test/haml-spec/lua_haml_spec.lua +38 -0
- data/test/haml-spec/perl_haml_test.pl +81 -0
- data/test/haml-spec/ruby_haml_test.rb +23 -0
- data/test/{haml/spec → haml-spec}/tests.json +132 -54
- data/test/{haml/helper_test.rb → helper_test.rb} +50 -36
- data/test/{haml/html2haml → html2haml}/erb_tests.rb +0 -0
- data/test/{haml/html2haml_test.rb → html2haml_test.rb} +11 -5
- data/test/{haml/markaby → markaby}/standard.mab +0 -0
- data/test/{haml/mocks → mocks}/article.rb +0 -0
- data/test/{haml/results → results}/content_for_layout.xhtml +0 -0
- data/test/{haml/results → results}/eval_suppressed.xhtml +0 -0
- data/test/{haml/results → results}/helpers.xhtml +0 -0
- data/test/{haml/results → results}/helpful.xhtml +0 -0
- data/test/{haml/results → results}/just_stuff.xhtml +0 -0
- data/test/{haml/results → results}/list.xhtml +0 -0
- data/test/{haml/results → results}/nuke_inner_whitespace.xhtml +0 -0
- data/test/{haml/results → results}/nuke_outer_whitespace.xhtml +0 -0
- data/test/{haml/results → results}/original_engine.xhtml +0 -0
- data/test/{haml/results → results}/partial_layout.xhtml +0 -0
- data/test/{haml/results → results}/partials.xhtml +0 -0
- data/test/{haml/results → results}/render_layout.xhtml +0 -0
- data/test/{haml/results → results}/silent_script.xhtml +1 -1
- data/test/{haml/results → results}/standard.xhtml +0 -0
- data/test/{haml/results → results}/tag_parsing.xhtml +0 -0
- data/test/{haml/results → results}/very_basic.xhtml +0 -0
- data/test/{haml/results → results}/whitespace_handling.xhtml +46 -50
- data/test/{haml/template_test.rb → template_test.rb} +20 -81
- data/test/{haml/templates → templates}/_av_partial_1.haml +1 -1
- data/test/{haml/templates → templates}/_av_partial_1_ugly.haml +1 -1
- data/test/{haml/templates → templates}/_av_partial_2.haml +1 -1
- data/test/{haml/templates → templates}/_av_partial_2_ugly.haml +1 -1
- data/test/{haml/templates → templates}/_layout.erb +0 -0
- data/test/{haml/templates → templates}/_layout_for_partial.haml +0 -0
- data/test/{haml/templates → templates}/_partial.haml +0 -0
- data/test/{haml/templates → templates}/_text_area.haml +0 -0
- data/test/{haml/templates → templates}/action_view.haml +1 -1
- data/test/{haml/templates → templates}/action_view_ugly.haml +1 -1
- data/test/{haml/templates → templates}/breakage.haml +0 -0
- data/test/{haml/templates → templates}/content_for_layout.haml +0 -0
- data/test/{haml/templates → templates}/eval_suppressed.haml +0 -0
- data/test/{haml/templates → templates}/helpers.haml +0 -0
- data/test/{haml/templates → templates}/helpful.haml +0 -0
- data/test/{haml/templates → templates}/just_stuff.haml +0 -0
- data/test/{haml/templates → templates}/list.haml +0 -0
- data/test/{haml/templates → templates}/nuke_inner_whitespace.haml +0 -0
- data/test/{haml/templates → templates}/nuke_outer_whitespace.haml +0 -0
- data/test/{haml/templates → templates}/original_engine.haml +0 -0
- data/test/templates/partial_layout.haml +3 -0
- data/test/{haml/templates → templates}/partialize.haml +0 -0
- data/test/{haml/templates → templates}/partials.haml +0 -0
- data/test/{haml/templates → templates}/render_layout.haml +0 -0
- data/test/{haml/templates → templates}/silent_script.haml +2 -2
- data/test/{haml/templates → templates}/standard.haml +0 -0
- data/test/{haml/templates → templates}/standard_ugly.haml +0 -0
- data/test/{haml/templates → templates}/tag_parsing.haml +0 -0
- data/test/{haml/templates → templates}/very_basic.haml +0 -0
- data/test/{haml/templates → templates}/whitespace_handling.haml +0 -0
- data/test/test_helper.rb +42 -34
- data/test/util_test.rb +80 -0
- metadata +259 -427
- data/CONTRIBUTING +0 -3
- data/REVISION +0 -1
- data/VERSION +0 -1
- data/VERSION_NAME +0 -1
- data/extra/update_watch.rb +0 -13
- data/lib/haml/root.rb +0 -7
- data/lib/haml/shared.rb +0 -78
- data/lib/haml/template/patch.rb +0 -58
- data/lib/sass.rb +0 -8
- data/lib/sass/plugin.rb +0 -10
- data/lib/sass/rails2_shim.rb +0 -9
- data/lib/sass/rails3_shim.rb +0 -16
- data/test/benchmark.rb +0 -91
- data/test/gemfiles/Gemfile.rails-2.0.x +0 -8
- data/test/gemfiles/Gemfile.rails-2.0.x.lock +0 -38
- data/test/gemfiles/Gemfile.rails-2.1.x +0 -8
- data/test/gemfiles/Gemfile.rails-2.1.x.lock +0 -38
- data/test/gemfiles/Gemfile.rails-2.2.x +0 -8
- data/test/gemfiles/Gemfile.rails-2.2.x.lock +0 -38
- data/test/gemfiles/Gemfile.rails-2.3.x +0 -8
- data/test/gemfiles/Gemfile.rails-2.3.x.lock +0 -40
- data/test/gemfiles/Gemfile.rails-3.0.x.lock +0 -85
- data/test/gemfiles/Gemfile.rails-3.1.x.lock +0 -98
- data/test/gemfiles/Gemfile.rails-xss-2.3.x +0 -9
- data/test/gemfiles/Gemfile.rails-xss-2.3.x.lock +0 -42
- data/test/haml/results/filters.xhtml +0 -62
- data/test/haml/spec/lua_haml_spec.lua +0 -30
- data/test/haml/spec/ruby_haml_test.rb +0 -19
- data/test/haml/spec_test.rb +0 -44
- data/test/haml/templates/filters.haml +0 -66
- data/test/haml/templates/partial_layout.haml +0 -10
- data/test/haml/util_test.rb +0 -300
- data/test/linked_rails.rb +0 -42
- data/vendor/sass/CONTRIBUTING +0 -3
- data/vendor/sass/MIT-LICENSE +0 -20
- data/vendor/sass/README.md +0 -201
- data/vendor/sass/Rakefile +0 -339
- data/vendor/sass/TODO +0 -39
- data/vendor/sass/VERSION +0 -1
- data/vendor/sass/VERSION_NAME +0 -1
- data/vendor/sass/bin/sass +0 -8
- data/vendor/sass/bin/sass-convert +0 -7
- data/vendor/sass/bin/scss +0 -8
- data/vendor/sass/doc-src/FAQ.md +0 -35
- data/vendor/sass/doc-src/INDENTED_SYNTAX.md +0 -210
- data/vendor/sass/doc-src/SASS_CHANGELOG.md +0 -2327
- data/vendor/sass/doc-src/SASS_REFERENCE.md +0 -1965
- data/vendor/sass/doc-src/SCSS_FOR_SASS_USERS.md +0 -155
- data/vendor/sass/ext/extconf.rb +0 -10
- data/vendor/sass/extra/update_watch.rb +0 -13
- data/vendor/sass/init.rb +0 -18
- data/vendor/sass/lib/sass.rb +0 -73
- data/vendor/sass/lib/sass/cache_stores.rb +0 -15
- data/vendor/sass/lib/sass/cache_stores/base.rb +0 -86
- data/vendor/sass/lib/sass/cache_stores/chain.rb +0 -33
- data/vendor/sass/lib/sass/cache_stores/filesystem.rb +0 -60
- data/vendor/sass/lib/sass/cache_stores/memory.rb +0 -47
- data/vendor/sass/lib/sass/cache_stores/null.rb +0 -25
- data/vendor/sass/lib/sass/callbacks.rb +0 -66
- data/vendor/sass/lib/sass/css.rb +0 -295
- data/vendor/sass/lib/sass/engine.rb +0 -878
- data/vendor/sass/lib/sass/environment.rb +0 -166
- data/vendor/sass/lib/sass/error.rb +0 -201
- data/vendor/sass/lib/sass/exec.rb +0 -672
- data/vendor/sass/lib/sass/importers.rb +0 -22
- data/vendor/sass/lib/sass/importers/base.rb +0 -139
- data/vendor/sass/lib/sass/importers/filesystem.rb +0 -149
- data/vendor/sass/lib/sass/less.rb +0 -382
- data/vendor/sass/lib/sass/logger.rb +0 -15
- data/vendor/sass/lib/sass/logger/base.rb +0 -32
- data/vendor/sass/lib/sass/logger/log_level.rb +0 -49
- data/vendor/sass/lib/sass/plugin.rb +0 -132
- data/vendor/sass/lib/sass/plugin/compiler.rb +0 -383
- data/vendor/sass/lib/sass/plugin/configuration.rb +0 -123
- data/vendor/sass/lib/sass/plugin/generic.rb +0 -15
- data/vendor/sass/lib/sass/plugin/merb.rb +0 -48
- data/vendor/sass/lib/sass/plugin/rack.rb +0 -60
- data/vendor/sass/lib/sass/plugin/rails.rb +0 -47
- data/vendor/sass/lib/sass/plugin/staleness_checker.rb +0 -173
- data/vendor/sass/lib/sass/railtie.rb +0 -9
- data/vendor/sass/lib/sass/repl.rb +0 -58
- data/vendor/sass/lib/sass/root.rb +0 -7
- data/vendor/sass/lib/sass/script.rb +0 -40
- data/vendor/sass/lib/sass/script/bool.rb +0 -18
- data/vendor/sass/lib/sass/script/color.rb +0 -480
- data/vendor/sass/lib/sass/script/css_lexer.rb +0 -29
- data/vendor/sass/lib/sass/script/css_parser.rb +0 -31
- data/vendor/sass/lib/sass/script/funcall.rb +0 -175
- data/vendor/sass/lib/sass/script/functions.rb +0 -1386
- data/vendor/sass/lib/sass/script/interpolation.rb +0 -79
- data/vendor/sass/lib/sass/script/lexer.rb +0 -339
- data/vendor/sass/lib/sass/script/list.rb +0 -83
- data/vendor/sass/lib/sass/script/literal.rb +0 -250
- data/vendor/sass/lib/sass/script/node.rb +0 -99
- data/vendor/sass/lib/sass/script/number.rb +0 -452
- data/vendor/sass/lib/sass/script/operation.rb +0 -99
- data/vendor/sass/lib/sass/script/parser.rb +0 -474
- data/vendor/sass/lib/sass/script/string.rb +0 -51
- data/vendor/sass/lib/sass/script/string_interpolation.rb +0 -103
- data/vendor/sass/lib/sass/script/unary_operation.rb +0 -64
- data/vendor/sass/lib/sass/script/variable.rb +0 -59
- data/vendor/sass/lib/sass/scss.rb +0 -17
- data/vendor/sass/lib/sass/scss/css_parser.rb +0 -46
- data/vendor/sass/lib/sass/scss/parser.rb +0 -960
- data/vendor/sass/lib/sass/scss/rx.rb +0 -128
- data/vendor/sass/lib/sass/scss/sass_parser.rb +0 -11
- data/vendor/sass/lib/sass/scss/script_lexer.rb +0 -15
- data/vendor/sass/lib/sass/scss/script_parser.rb +0 -25
- data/vendor/sass/lib/sass/scss/static_parser.rb +0 -40
- data/vendor/sass/lib/sass/selector.rb +0 -361
- data/vendor/sass/lib/sass/selector/abstract_sequence.rb +0 -62
- data/vendor/sass/lib/sass/selector/comma_sequence.rb +0 -81
- data/vendor/sass/lib/sass/selector/sequence.rb +0 -233
- data/vendor/sass/lib/sass/selector/simple.rb +0 -113
- data/vendor/sass/lib/sass/selector/simple_sequence.rb +0 -134
- data/vendor/sass/lib/sass/shared.rb +0 -78
- data/vendor/sass/lib/sass/tree/charset_node.rb +0 -22
- data/vendor/sass/lib/sass/tree/comment_node.rb +0 -90
- data/vendor/sass/lib/sass/tree/debug_node.rb +0 -18
- data/vendor/sass/lib/sass/tree/directive_node.rb +0 -23
- data/vendor/sass/lib/sass/tree/each_node.rb +0 -24
- data/vendor/sass/lib/sass/tree/extend_node.rb +0 -29
- data/vendor/sass/lib/sass/tree/for_node.rb +0 -36
- data/vendor/sass/lib/sass/tree/function_node.rb +0 -27
- data/vendor/sass/lib/sass/tree/if_node.rb +0 -52
- data/vendor/sass/lib/sass/tree/import_node.rb +0 -68
- data/vendor/sass/lib/sass/tree/media_node.rb +0 -32
- data/vendor/sass/lib/sass/tree/mixin_def_node.rb +0 -27
- data/vendor/sass/lib/sass/tree/mixin_node.rb +0 -32
- data/vendor/sass/lib/sass/tree/node.rb +0 -201
- data/vendor/sass/lib/sass/tree/prop_node.rb +0 -148
- data/vendor/sass/lib/sass/tree/return_node.rb +0 -18
- data/vendor/sass/lib/sass/tree/root_node.rb +0 -28
- data/vendor/sass/lib/sass/tree/rule_node.rb +0 -136
- data/vendor/sass/lib/sass/tree/variable_node.rb +0 -30
- data/vendor/sass/lib/sass/tree/visitors/base.rb +0 -75
- data/vendor/sass/lib/sass/tree/visitors/check_nesting.rb +0 -133
- data/vendor/sass/lib/sass/tree/visitors/convert.rb +0 -260
- data/vendor/sass/lib/sass/tree/visitors/cssize.rb +0 -175
- data/vendor/sass/lib/sass/tree/visitors/deep_copy.rb +0 -87
- data/vendor/sass/lib/sass/tree/visitors/perform.rb +0 -332
- data/vendor/sass/lib/sass/tree/visitors/set_options.rb +0 -97
- data/vendor/sass/lib/sass/tree/visitors/to_css.rb +0 -210
- data/vendor/sass/lib/sass/tree/warn_node.rb +0 -18
- data/vendor/sass/lib/sass/tree/while_node.rb +0 -18
- data/vendor/sass/lib/sass/util.rb +0 -721
- data/vendor/sass/lib/sass/util/subset_map.rb +0 -101
- data/vendor/sass/lib/sass/version.rb +0 -112
- data/vendor/sass/rails/init.rb +0 -1
- data/vendor/sass/sass.gemspec +0 -33
- data/vendor/sass/test/Gemfile +0 -4
- data/vendor/sass/test/Gemfile.lock +0 -19
- data/vendor/sass/test/sass/cache_test.rb +0 -89
- data/vendor/sass/test/sass/callbacks_test.rb +0 -61
- data/vendor/sass/test/sass/conversion_test.rb +0 -1199
- data/vendor/sass/test/sass/css2sass_test.rb +0 -373
- data/vendor/sass/test/sass/data/hsl-rgb.txt +0 -319
- data/vendor/sass/test/sass/engine_test.rb +0 -2567
- data/vendor/sass/test/sass/extend_test.rb +0 -1348
- data/vendor/sass/test/sass/fixtures/test_staleness_check_across_importers.css +0 -1
- data/vendor/sass/test/sass/fixtures/test_staleness_check_across_importers.scss +0 -1
- data/vendor/sass/test/sass/functions_test.rb +0 -1038
- data/vendor/sass/test/sass/importer_test.rb +0 -192
- data/vendor/sass/test/sass/less_conversion_test.rb +0 -653
- data/vendor/sass/test/sass/logger_test.rb +0 -58
- data/vendor/sass/test/sass/mock_importer.rb +0 -49
- data/vendor/sass/test/sass/more_results/more1.css +0 -9
- data/vendor/sass/test/sass/more_results/more1_with_line_comments.css +0 -26
- data/vendor/sass/test/sass/more_results/more_import.css +0 -29
- data/vendor/sass/test/sass/more_templates/_more_partial.sass +0 -2
- data/vendor/sass/test/sass/more_templates/more1.sass +0 -23
- data/vendor/sass/test/sass/more_templates/more_import.sass +0 -11
- data/vendor/sass/test/sass/plugin_test.rb +0 -472
- data/vendor/sass/test/sass/results/alt.css +0 -4
- data/vendor/sass/test/sass/results/basic.css +0 -9
- data/vendor/sass/test/sass/results/compact.css +0 -5
- data/vendor/sass/test/sass/results/complex.css +0 -86
- data/vendor/sass/test/sass/results/compressed.css +0 -1
- data/vendor/sass/test/sass/results/expanded.css +0 -19
- data/vendor/sass/test/sass/results/if.css +0 -3
- data/vendor/sass/test/sass/results/import.css +0 -31
- data/vendor/sass/test/sass/results/import_charset.css +0 -4
- data/vendor/sass/test/sass/results/import_charset_1_8.css +0 -4
- data/vendor/sass/test/sass/results/import_charset_ibm866.css +0 -4
- data/vendor/sass/test/sass/results/line_numbers.css +0 -49
- data/vendor/sass/test/sass/results/mixins.css +0 -95
- data/vendor/sass/test/sass/results/multiline.css +0 -24
- data/vendor/sass/test/sass/results/nested.css +0 -22
- data/vendor/sass/test/sass/results/options.css +0 -1
- data/vendor/sass/test/sass/results/parent_ref.css +0 -13
- data/vendor/sass/test/sass/results/script.css +0 -16
- data/vendor/sass/test/sass/results/scss_import.css +0 -31
- data/vendor/sass/test/sass/results/scss_importee.css +0 -2
- data/vendor/sass/test/sass/results/subdir/nested_subdir/nested_subdir.css +0 -1
- data/vendor/sass/test/sass/results/subdir/subdir.css +0 -3
- data/vendor/sass/test/sass/results/units.css +0 -11
- data/vendor/sass/test/sass/results/warn.css +0 -0
- data/vendor/sass/test/sass/results/warn_imported.css +0 -0
- data/vendor/sass/test/sass/script_conversion_test.rb +0 -285
- data/vendor/sass/test/sass/script_test.rb +0 -514
- data/vendor/sass/test/sass/scss/css_test.rb +0 -922
- data/vendor/sass/test/sass/scss/rx_test.rb +0 -156
- data/vendor/sass/test/sass/scss/scss_test.rb +0 -1273
- data/vendor/sass/test/sass/scss/test_helper.rb +0 -37
- data/vendor/sass/test/sass/templates/_imported_charset_ibm866.sass +0 -4
- data/vendor/sass/test/sass/templates/_imported_charset_utf8.sass +0 -4
- data/vendor/sass/test/sass/templates/_partial.sass +0 -2
- data/vendor/sass/test/sass/templates/alt.sass +0 -16
- data/vendor/sass/test/sass/templates/basic.sass +0 -23
- data/vendor/sass/test/sass/templates/bork1.sass +0 -2
- data/vendor/sass/test/sass/templates/bork2.sass +0 -2
- data/vendor/sass/test/sass/templates/bork3.sass +0 -2
- data/vendor/sass/test/sass/templates/bork4.sass +0 -2
- data/vendor/sass/test/sass/templates/bork5.sass +0 -3
- data/vendor/sass/test/sass/templates/compact.sass +0 -17
- data/vendor/sass/test/sass/templates/complex.sass +0 -305
- data/vendor/sass/test/sass/templates/compressed.sass +0 -15
- data/vendor/sass/test/sass/templates/expanded.sass +0 -17
- data/vendor/sass/test/sass/templates/if.sass +0 -11
- data/vendor/sass/test/sass/templates/import.sass +0 -12
- data/vendor/sass/test/sass/templates/import_charset.sass +0 -7
- data/vendor/sass/test/sass/templates/import_charset_1_8.sass +0 -4
- data/vendor/sass/test/sass/templates/import_charset_ibm866.sass +0 -9
- data/vendor/sass/test/sass/templates/importee.less +0 -2
- data/vendor/sass/test/sass/templates/importee.sass +0 -19
- data/vendor/sass/test/sass/templates/line_numbers.sass +0 -13
- data/vendor/sass/test/sass/templates/mixin_bork.sass +0 -5
- data/vendor/sass/test/sass/templates/mixins.sass +0 -76
- data/vendor/sass/test/sass/templates/multiline.sass +0 -20
- data/vendor/sass/test/sass/templates/nested.sass +0 -25
- data/vendor/sass/test/sass/templates/nested_bork1.sass +0 -2
- data/vendor/sass/test/sass/templates/nested_bork2.sass +0 -2
- data/vendor/sass/test/sass/templates/nested_bork3.sass +0 -2
- data/vendor/sass/test/sass/templates/nested_bork4.sass +0 -2
- data/vendor/sass/test/sass/templates/nested_bork5.sass +0 -2
- data/vendor/sass/test/sass/templates/nested_import.sass +0 -2
- data/vendor/sass/test/sass/templates/nested_mixin_bork.sass +0 -6
- data/vendor/sass/test/sass/templates/options.sass +0 -2
- data/vendor/sass/test/sass/templates/parent_ref.sass +0 -25
- data/vendor/sass/test/sass/templates/script.sass +0 -101
- data/vendor/sass/test/sass/templates/scss_import.scss +0 -11
- data/vendor/sass/test/sass/templates/scss_importee.scss +0 -1
- data/vendor/sass/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +0 -2
- data/vendor/sass/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +0 -3
- data/vendor/sass/test/sass/templates/subdir/subdir.sass +0 -6
- data/vendor/sass/test/sass/templates/units.sass +0 -11
- data/vendor/sass/test/sass/templates/warn.sass +0 -3
- data/vendor/sass/test/sass/templates/warn_imported.sass +0 -4
- data/vendor/sass/test/sass/test_helper.rb +0 -8
- data/vendor/sass/test/sass/util/subset_map_test.rb +0 -91
- data/vendor/sass/test/sass/util_test.rb +0 -266
- data/vendor/sass/test/test_helper.rb +0 -69
- data/vendor/sass/vendor/fssm/Gemfile +0 -3
- data/vendor/sass/vendor/fssm/LICENSE +0 -20
- data/vendor/sass/vendor/fssm/README.markdown +0 -83
- data/vendor/sass/vendor/fssm/Rakefile +0 -11
- data/vendor/sass/vendor/fssm/example.rb +0 -12
- data/vendor/sass/vendor/fssm/fssm.gemspec +0 -24
- data/vendor/sass/vendor/fssm/lib/fssm.rb +0 -37
- data/vendor/sass/vendor/fssm/lib/fssm/backends/fsevents.rb +0 -36
- data/vendor/sass/vendor/fssm/lib/fssm/backends/inotify.rb +0 -26
- data/vendor/sass/vendor/fssm/lib/fssm/backends/polling.rb +0 -25
- data/vendor/sass/vendor/fssm/lib/fssm/backends/rbfsevent.rb +0 -42
- data/vendor/sass/vendor/fssm/lib/fssm/backends/rubycocoa/fsevents.rb +0 -131
- data/vendor/sass/vendor/fssm/lib/fssm/monitor.rb +0 -36
- data/vendor/sass/vendor/fssm/lib/fssm/path.rb +0 -94
- data/vendor/sass/vendor/fssm/lib/fssm/pathname.rb +0 -36
- data/vendor/sass/vendor/fssm/lib/fssm/state/directory.rb +0 -75
- data/vendor/sass/vendor/fssm/lib/fssm/state/file.rb +0 -24
- data/vendor/sass/vendor/fssm/lib/fssm/support.rb +0 -92
- data/vendor/sass/vendor/fssm/lib/fssm/tree.rb +0 -176
- data/vendor/sass/vendor/fssm/lib/fssm/version.rb +0 -3
- data/vendor/sass/vendor/fssm/profile/prof-cache.rb +0 -40
- data/vendor/sass/vendor/fssm/profile/prof-fssm-pathname.html +0 -1231
- data/vendor/sass/vendor/fssm/profile/prof-pathname-rubinius.rb +0 -35
- data/vendor/sass/vendor/fssm/profile/prof-pathname.rb +0 -68
- data/vendor/sass/vendor/fssm/profile/prof-plain-pathname.html +0 -988
- data/vendor/sass/vendor/fssm/profile/prof.html +0 -2379
- data/vendor/sass/vendor/fssm/spec/count_down_latch.rb +0 -151
- data/vendor/sass/vendor/fssm/spec/monitor_spec.rb +0 -202
- data/vendor/sass/vendor/fssm/spec/path_spec.rb +0 -96
- data/vendor/sass/vendor/fssm/spec/root/duck/quack.txt +0 -0
- data/vendor/sass/vendor/fssm/spec/root/file.css +0 -0
- data/vendor/sass/vendor/fssm/spec/root/file.rb +0 -0
- data/vendor/sass/vendor/fssm/spec/root/file.yml +0 -0
- data/vendor/sass/vendor/fssm/spec/root/moo/cow.txt +0 -0
- data/vendor/sass/vendor/fssm/spec/spec_helper.rb +0 -14
- data/vendor/sass/yard/callbacks.rb +0 -29
- data/vendor/sass/yard/default/fulldoc/html/css/common.sass +0 -26
- data/vendor/sass/yard/default/layout/html/footer.erb +0 -12
- data/vendor/sass/yard/inherited_hash.rb +0 -41
@@ -1 +0,0 @@
|
|
1
|
-
#pi { width: 314px; }
|
File without changes
|
File without changes
|
@@ -1,285 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
4
|
-
require 'sass/engine'
|
5
|
-
|
6
|
-
class SassScriptConversionTest < Test::Unit::TestCase
|
7
|
-
def test_bool
|
8
|
-
assert_renders "true"
|
9
|
-
assert_renders "false"
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_color
|
13
|
-
assert_renders "#abcdef"
|
14
|
-
assert_renders "blue"
|
15
|
-
assert_renders "rgba(0, 1, 2, 0.2)"
|
16
|
-
|
17
|
-
assert_equal "#aabbcc", render("#abc")
|
18
|
-
assert_equal "blue", render("#0000ff")
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_number
|
22
|
-
assert_renders "10"
|
23
|
-
assert_renders "10.35"
|
24
|
-
assert_renders "12px"
|
25
|
-
assert_renders "12.45px"
|
26
|
-
|
27
|
-
assert_equal "12.346", render("12.345678901")
|
28
|
-
end
|
29
|
-
|
30
|
-
def test_string
|
31
|
-
assert_renders '"foo"'
|
32
|
-
assert_renders '"bar baz"'
|
33
|
-
assert_equal '"baz bang"', render("'baz bang'")
|
34
|
-
end
|
35
|
-
|
36
|
-
def test_string_quotes
|
37
|
-
assert_equal "'quote\"quote'", render('"quote\\"quote"')
|
38
|
-
assert_equal '"quote\'quote"', render("'quote\\'quote'")
|
39
|
-
assert_renders '"quote\'quote\\"quote"'
|
40
|
-
assert_equal '"quote\'quote\\"quote"', render("'quote\\'quote\"quote'")
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_string_escapes
|
44
|
-
assert_renders '"foo\\\\bar"'
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_funcall
|
48
|
-
assert_renders "foo(true, blue)"
|
49
|
-
assert_renders "hsla(20deg, 30%, 50%, 0.3)"
|
50
|
-
assert_renders "blam()"
|
51
|
-
|
52
|
-
assert_renders "-\xC3\xBFoo(12px)"
|
53
|
-
assert_renders "-foo(12px)"
|
54
|
-
end
|
55
|
-
|
56
|
-
def test_funcall_with_keyword_args
|
57
|
-
assert_renders "foo(arg1, arg2, $karg1: val, $karg2: val2)"
|
58
|
-
assert_renders "foo($karg1: val, $karg2: val2)"
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_url
|
62
|
-
assert_renders "url(foo.gif)"
|
63
|
-
assert_renders "url($var)"
|
64
|
-
assert_renders "url(\#{$var}/flip.gif)"
|
65
|
-
end
|
66
|
-
|
67
|
-
def test_variable
|
68
|
-
assert_renders "$foo-bar"
|
69
|
-
assert_renders "$flaznicate"
|
70
|
-
end
|
71
|
-
|
72
|
-
def self.test_precedence(outer, inner)
|
73
|
-
op_outer = Sass::Script::Lexer::OPERATORS_REVERSE[outer]
|
74
|
-
op_inner = Sass::Script::Lexer::OPERATORS_REVERSE[inner]
|
75
|
-
class_eval <<RUBY
|
76
|
-
def test_precedence_#{outer}_#{inner}
|
77
|
-
assert_renders "$foo #{op_outer} $bar #{op_inner} $baz"
|
78
|
-
assert_renders "$foo #{op_inner} $bar #{op_outer} $baz"
|
79
|
-
|
80
|
-
assert_renders "($foo #{op_outer} $bar) #{op_inner} $baz"
|
81
|
-
assert_renders "$foo #{op_inner} ($bar #{op_outer} $baz)"
|
82
|
-
|
83
|
-
assert_equal "$foo #{op_outer} $bar #{op_inner} $baz",
|
84
|
-
render("$foo #{op_outer} ($bar #{op_inner} $baz)")
|
85
|
-
assert_equal "$foo #{op_inner} $bar #{op_outer} $baz",
|
86
|
-
render("($foo #{op_inner} $bar) #{op_outer} $baz")
|
87
|
-
end
|
88
|
-
RUBY
|
89
|
-
end
|
90
|
-
|
91
|
-
def self.assert_associative(op_name, sibling_name)
|
92
|
-
op = separator_for(op_name)
|
93
|
-
sibling = separator_for(sibling_name)
|
94
|
-
class_eval <<RUBY
|
95
|
-
def test_associative_#{op_name}_#{sibling_name}
|
96
|
-
assert_renders "$foo#{op}$bar#{op}$baz"
|
97
|
-
|
98
|
-
assert_equal "$foo#{op}$bar#{op}$baz",
|
99
|
-
render("$foo#{op}($bar#{op}$baz)")
|
100
|
-
assert_equal "$foo#{op}$bar#{op}$baz",
|
101
|
-
render("($foo#{op}$bar)#{op}$baz")
|
102
|
-
|
103
|
-
assert_equal "$foo#{op}$bar#{sibling}$baz",
|
104
|
-
render("$foo#{op}($bar#{sibling}$baz)")
|
105
|
-
assert_equal "$foo#{sibling}$bar#{op}$baz",
|
106
|
-
render("($foo#{sibling}$bar)#{op}$baz")
|
107
|
-
end
|
108
|
-
RUBY
|
109
|
-
end
|
110
|
-
|
111
|
-
def self.separator_for(op_name)
|
112
|
-
case op_name
|
113
|
-
when :comma; ", "
|
114
|
-
when :space; " "
|
115
|
-
else; " #{Sass::Script::Lexer::OPERATORS_REVERSE[op_name]} "
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
def self.assert_non_associative(op_name, sibling_name)
|
120
|
-
op = Sass::Script::Lexer::OPERATORS_REVERSE[op_name]
|
121
|
-
sibling = Sass::Script::Lexer::OPERATORS_REVERSE[sibling_name]
|
122
|
-
class_eval <<RUBY
|
123
|
-
def test_non_associative_#{op_name}_#{sibling_name}
|
124
|
-
assert_renders "$foo #{op} $bar #{op} $baz"
|
125
|
-
|
126
|
-
assert_renders "$foo #{op} ($bar #{op} $baz)"
|
127
|
-
assert_equal "$foo #{op} $bar #{op} $baz",
|
128
|
-
render("($foo #{op} $bar) #{op} $baz")
|
129
|
-
|
130
|
-
assert_renders "$foo #{op} ($bar #{sibling} $baz)"
|
131
|
-
assert_equal "$foo #{sibling} $bar #{op} $baz",
|
132
|
-
render("($foo #{sibling} $bar) #{op} $baz")
|
133
|
-
end
|
134
|
-
RUBY
|
135
|
-
end
|
136
|
-
|
137
|
-
test_precedence :or, :and
|
138
|
-
test_precedence :and, :eq
|
139
|
-
test_precedence :and, :neq
|
140
|
-
test_precedence :eq, :gt
|
141
|
-
test_precedence :eq, :gte
|
142
|
-
test_precedence :eq, :lt
|
143
|
-
test_precedence :eq, :lte
|
144
|
-
test_precedence :gt, :plus
|
145
|
-
test_precedence :gt, :minus
|
146
|
-
test_precedence :plus, :times
|
147
|
-
test_precedence :plus, :div
|
148
|
-
test_precedence :plus, :mod
|
149
|
-
|
150
|
-
assert_associative :plus, :minus
|
151
|
-
assert_associative :times, :div
|
152
|
-
assert_associative :times, :mod
|
153
|
-
|
154
|
-
assert_non_associative :minus, :plus
|
155
|
-
assert_non_associative :div, :times
|
156
|
-
assert_non_associative :mod, :times
|
157
|
-
assert_non_associative :gt, :gte
|
158
|
-
assert_non_associative :gte, :lt
|
159
|
-
assert_non_associative :lt, :lte
|
160
|
-
assert_non_associative :lte, :gt
|
161
|
-
|
162
|
-
def test_comma_precedence
|
163
|
-
assert_renders "$foo, $bar, $baz"
|
164
|
-
|
165
|
-
assert_renders "$foo ($bar, $baz)"
|
166
|
-
assert_renders "($foo, $bar) $baz"
|
167
|
-
|
168
|
-
assert_equal "$foo, $bar $baz", render("$foo, ($bar $baz)")
|
169
|
-
assert_equal "$foo $bar, $baz", render("($foo $bar), $baz")
|
170
|
-
|
171
|
-
assert_equal "$foo, ($bar, $baz)", render("$foo, ($bar, $baz)")
|
172
|
-
assert_equal "($foo, $bar), $baz", render("($foo, $bar), $baz")
|
173
|
-
end
|
174
|
-
|
175
|
-
def test_space_precedence
|
176
|
-
assert_renders "$foo $bar $baz"
|
177
|
-
|
178
|
-
assert_renders "$foo or ($bar $baz)"
|
179
|
-
assert_renders "($foo $bar) or $baz"
|
180
|
-
|
181
|
-
assert_equal "$foo $bar or $baz", render("$foo ($bar or $baz)")
|
182
|
-
assert_equal "$foo or $bar $baz", render("($foo or $bar) $baz")
|
183
|
-
|
184
|
-
assert_equal "$foo ($bar $baz)", render("$foo ($bar $baz)")
|
185
|
-
assert_equal "($foo $bar) $baz", render("($foo $bar) $baz")
|
186
|
-
end
|
187
|
-
|
188
|
-
def test_unary_op
|
189
|
-
assert_renders "-12px"
|
190
|
-
assert_renders '/"foo"'
|
191
|
-
assert_renders 'not true'
|
192
|
-
|
193
|
-
assert_renders "-(foo(12px))"
|
194
|
-
assert_renders "-(-foo(12px))"
|
195
|
-
assert_renders "-(_foo(12px))"
|
196
|
-
assert_renders "-(\xC3\xBFoo(12px))"
|
197
|
-
assert_renders "-(blue)"
|
198
|
-
|
199
|
-
assert_equal 'not true or false', render('(not true) or false')
|
200
|
-
assert_equal 'not (true or false)', render('not (true or false)')
|
201
|
-
end
|
202
|
-
|
203
|
-
def test_interpolation
|
204
|
-
assert_renders "$foo\#{$bar}$baz"
|
205
|
-
assert_renders "$foo\#{$bar} $baz"
|
206
|
-
assert_renders "$foo \#{$bar}$baz"
|
207
|
-
assert_renders "$foo \#{$bar} $baz"
|
208
|
-
assert_renders "$foo \#{$bar}\#{$bang} $baz"
|
209
|
-
assert_renders "$foo \#{$bar} \#{$bang} $baz"
|
210
|
-
assert_renders "\#{$bar}$baz"
|
211
|
-
assert_renders "$foo\#{$bar}"
|
212
|
-
assert_renders "\#{$bar}"
|
213
|
-
end
|
214
|
-
|
215
|
-
def test_interpolation_in_function
|
216
|
-
assert_renders 'flabnabbit(#{1 + "foo"})'
|
217
|
-
assert_renders 'flabnabbit($foo #{1 + "foo"}$baz)'
|
218
|
-
assert_renders 'flabnabbit($foo #{1 + "foo"}#{2 + "bar"} $baz)'
|
219
|
-
end
|
220
|
-
|
221
|
-
def test_interpolation_near_operators
|
222
|
-
assert_renders '#{1 + 2} , #{3 + 4}'
|
223
|
-
assert_renders '#{1 + 2}, #{3 + 4}'
|
224
|
-
assert_renders '#{1 + 2} ,#{3 + 4}'
|
225
|
-
assert_renders '#{1 + 2},#{3 + 4}'
|
226
|
-
assert_renders '#{1 + 2}, #{3 + 4}, #{5 + 6}'
|
227
|
-
assert_renders '3, #{3 + 4}, 11'
|
228
|
-
|
229
|
-
assert_renders '3 / #{3 + 4}'
|
230
|
-
assert_renders '3 /#{3 + 4}'
|
231
|
-
assert_renders '3/ #{3 + 4}'
|
232
|
-
assert_renders '3/#{3 + 4}'
|
233
|
-
|
234
|
-
assert_renders '#{1 + 2} * 7'
|
235
|
-
assert_renders '#{1 + 2}* 7'
|
236
|
-
assert_renders '#{1 + 2} *7'
|
237
|
-
assert_renders '#{1 + 2}*7'
|
238
|
-
|
239
|
-
assert_renders '-#{1 + 2}'
|
240
|
-
assert_renders '- #{1 + 2}'
|
241
|
-
|
242
|
-
assert_renders '5 + #{1 + 2} * #{3 + 4}'
|
243
|
-
assert_renders '5 +#{1 + 2} * #{3 + 4}'
|
244
|
-
assert_renders '5+#{1 + 2} * #{3 + 4}'
|
245
|
-
assert_renders '#{1 + 2} * #{3 + 4} + 5'
|
246
|
-
assert_renders '#{1 + 2} * #{3 + 4}+ 5'
|
247
|
-
assert_renders '#{1 + 2} * #{3 + 4}+5'
|
248
|
-
|
249
|
-
assert_equal '5 / #{1 + 2} + #{3 + 4}', render('5 / (#{1 + 2} + #{3 + 4})')
|
250
|
-
assert_equal '5 / #{1 + 2} + #{3 + 4}', render('5 /(#{1 + 2} + #{3 + 4})')
|
251
|
-
assert_equal '5 / #{1 + 2} + #{3 + 4}', render('5 /( #{1 + 2} + #{3 + 4} )')
|
252
|
-
assert_equal '#{1 + 2} + #{3 + 4} / 5', render('(#{1 + 2} + #{3 + 4}) / 5')
|
253
|
-
assert_equal '#{1 + 2} + #{3 + 4} / 5', render('(#{1 + 2} + #{3 + 4})/ 5')
|
254
|
-
assert_equal '#{1 + 2} + #{3 + 4} / 5', render('( #{1 + 2} + #{3 + 4} )/ 5')
|
255
|
-
|
256
|
-
assert_renders '#{1 + 2} + 2 + 3'
|
257
|
-
assert_renders '#{1 + 2} +2 + 3'
|
258
|
-
end
|
259
|
-
|
260
|
-
def test_string_interpolation
|
261
|
-
assert_renders '"foo#{$bar}baz"'
|
262
|
-
assert_renders '"foo #{$bar}baz"'
|
263
|
-
assert_renders '"foo#{$bar} baz"'
|
264
|
-
assert_renders '"foo #{$bar} baz"'
|
265
|
-
assert_renders '"foo #{$bar}#{$bang} baz"'
|
266
|
-
assert_renders '"foo #{$bar} #{$bang} baz"'
|
267
|
-
assert_renders '"#{$bar}baz"'
|
268
|
-
assert_renders '"foo#{$bar}"'
|
269
|
-
assert_equal '#{$bar}', render('"#{$bar}"')
|
270
|
-
|
271
|
-
assert_equal '"foo#{$bar}baz"', render("'foo\#{$bar}baz'")
|
272
|
-
end
|
273
|
-
|
274
|
-
private
|
275
|
-
|
276
|
-
def assert_renders(script, options = {})
|
277
|
-
assert_equal(script, render(script, options))
|
278
|
-
end
|
279
|
-
|
280
|
-
def render(script, options = {})
|
281
|
-
munge_filename(options)
|
282
|
-
node = Sass::Script.parse(script, 1, 0, options)
|
283
|
-
node.to_sass
|
284
|
-
end
|
285
|
-
end
|
@@ -1,514 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
3
|
-
require 'sass/engine'
|
4
|
-
|
5
|
-
module Sass::Script::Functions::UserFunctions
|
6
|
-
def assert_options(val)
|
7
|
-
val.options[:foo]
|
8
|
-
Sass::Script::String.new("Options defined!")
|
9
|
-
end
|
10
|
-
|
11
|
-
def arg_error
|
12
|
-
assert_options
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
module Sass::Script::Functions
|
17
|
-
include Sass::Script::Functions::UserFunctions
|
18
|
-
end
|
19
|
-
|
20
|
-
class SassScriptTest < Test::Unit::TestCase
|
21
|
-
include Sass::Script
|
22
|
-
|
23
|
-
def test_color_checks_input
|
24
|
-
assert_raise_message(ArgumentError, "Blue value must be between 0 and 255") {Color.new([1, 2, -1])}
|
25
|
-
assert_raise_message(ArgumentError, "Red value must be between 0 and 255") {Color.new([256, 2, 3])}
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_color_checks_rgba_input
|
29
|
-
assert_raise_message(ArgumentError, "Alpha channel must be between 0 and 1") {Color.new([1, 2, 3, 1.1])}
|
30
|
-
assert_raise_message(ArgumentError, "Alpha channel must be between 0 and 1") {Color.new([1, 2, 3, -0.1])}
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_string_escapes
|
34
|
-
assert_equal "'", resolve("\"'\"")
|
35
|
-
assert_equal '"', resolve("\"\\\"\"")
|
36
|
-
assert_equal "\\\\", resolve("\"\\\\\"")
|
37
|
-
assert_equal "\\02fa", resolve("\"\\02fa\"")
|
38
|
-
|
39
|
-
assert_equal "'", resolve("'\\''")
|
40
|
-
assert_equal '"', resolve("'\"'")
|
41
|
-
assert_equal "\\\\", resolve("'\\\\'")
|
42
|
-
assert_equal "\\02fa", resolve("'\\02fa'")
|
43
|
-
end
|
44
|
-
|
45
|
-
def test_string_interpolation
|
46
|
-
assert_equal "foo2bar", resolve('\'foo#{1 + 1}bar\'')
|
47
|
-
assert_equal "foo2bar", resolve('"foo#{1 + 1}bar"')
|
48
|
-
assert_equal "foo1bar5baz4bang", resolve('\'foo#{1 + "bar#{2 + 3}baz" + 4}bang\'')
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_color_names
|
52
|
-
assert_equal "white", resolve("white")
|
53
|
-
assert_equal "white", resolve("#ffffff")
|
54
|
-
assert_equal "#fffffe", resolve("white - #000001")
|
55
|
-
end
|
56
|
-
|
57
|
-
def test_rgba_color_literals
|
58
|
-
assert_equal Sass::Script::Color.new([1, 2, 3, 0.75]), eval("rgba(1, 2, 3, 0.75)")
|
59
|
-
assert_equal "rgba(1, 2, 3, 0.75)", resolve("rgba(1, 2, 3, 0.75)")
|
60
|
-
|
61
|
-
assert_equal Sass::Script::Color.new([1, 2, 3, 0]), eval("rgba(1, 2, 3, 0)")
|
62
|
-
assert_equal "rgba(1, 2, 3, 0)", resolve("rgba(1, 2, 3, 0)")
|
63
|
-
|
64
|
-
assert_equal Sass::Script::Color.new([1, 2, 3]), eval("rgba(1, 2, 3, 1)")
|
65
|
-
assert_equal Sass::Script::Color.new([1, 2, 3, 1]), eval("rgba(1, 2, 3, 1)")
|
66
|
-
assert_equal "#010203", resolve("rgba(1, 2, 3, 1)")
|
67
|
-
assert_equal "white", resolve("rgba(255, 255, 255, 1)")
|
68
|
-
end
|
69
|
-
|
70
|
-
def test_rgba_color_math
|
71
|
-
assert_equal "rgba(50, 50, 100, 0.35)", resolve("rgba(1, 1, 2, 0.35) * rgba(50, 50, 50, 0.35)")
|
72
|
-
assert_equal "rgba(52, 52, 52, 0.25)", resolve("rgba(2, 2, 2, 0.25) + rgba(50, 50, 50, 0.25)")
|
73
|
-
|
74
|
-
assert_raise_message(Sass::SyntaxError, "Alpha channels must be equal: rgba(1, 2, 3, 0.15) + rgba(50, 50, 50, 0.75)") do
|
75
|
-
resolve("rgba(1, 2, 3, 0.15) + rgba(50, 50, 50, 0.75)")
|
76
|
-
end
|
77
|
-
assert_raise_message(Sass::SyntaxError, "Alpha channels must be equal: #123456 * rgba(50, 50, 50, 0.75)") do
|
78
|
-
resolve("#123456 * rgba(50, 50, 50, 0.75)")
|
79
|
-
end
|
80
|
-
assert_raise_message(Sass::SyntaxError, "Alpha channels must be equal: rgba(50, 50, 50, 0.75) / #123456") do
|
81
|
-
resolve("rgba(50, 50, 50, 0.75) / #123456")
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
def test_rgba_number_math
|
86
|
-
assert_equal "rgba(49, 49, 49, 0.75)", resolve("rgba(50, 50, 50, 0.75) - 1")
|
87
|
-
assert_equal "rgba(100, 100, 100, 0.75)", resolve("rgba(50, 50, 50, 0.75) * 2")
|
88
|
-
end
|
89
|
-
|
90
|
-
def test_rgba_rounding
|
91
|
-
assert_equal "rgba(10, 1, 0, 0.123)", resolve("rgba(10.0, 1.23456789, 0.0, 0.1234567)")
|
92
|
-
end
|
93
|
-
|
94
|
-
def test_compressed_colors
|
95
|
-
assert_equal "#123456", resolve("#123456", :style => :compressed)
|
96
|
-
assert_equal "rgba(1,2,3,0.5)", resolve("rgba(1, 2, 3, 0.5)", :style => :compressed)
|
97
|
-
assert_equal "#123", resolve("#112233", :style => :compressed)
|
98
|
-
assert_equal "#000", resolve("black", :style => :compressed)
|
99
|
-
assert_equal "red", resolve("#f00", :style => :compressed)
|
100
|
-
assert_equal "blue", resolve("#00f", :style => :compressed)
|
101
|
-
assert_equal "navy", resolve("#000080", :style => :compressed)
|
102
|
-
assert_equal "navy #fff", resolve("#000080 white", :style => :compressed)
|
103
|
-
assert_equal "This color is #fff", resolve('"This color is #{ white }"', :style => :compressed)
|
104
|
-
end
|
105
|
-
|
106
|
-
def test_compressed_comma
|
107
|
-
# assert_equal "foo,bar,baz", resolve("foo, bar, baz", :style => :compressed)
|
108
|
-
# assert_equal "foo,#baf,baz", resolve("foo, #baf, baz", :style => :compressed)
|
109
|
-
assert_equal "foo,#baf,red", resolve("foo, #baf, #f00", :style => :compressed)
|
110
|
-
end
|
111
|
-
|
112
|
-
def test_implicit_strings
|
113
|
-
assert_equal Sass::Script::String.new("foo"), eval("foo")
|
114
|
-
assert_equal Sass::Script::String.new("foo/bar"), eval("foo/bar")
|
115
|
-
end
|
116
|
-
|
117
|
-
def test_basic_interpolation
|
118
|
-
assert_equal "foo3bar", resolve("foo\#{1 + 2}bar")
|
119
|
-
assert_equal "foo3 bar", resolve("foo\#{1 + 2} bar")
|
120
|
-
assert_equal "foo 3bar", resolve("foo \#{1 + 2}bar")
|
121
|
-
assert_equal "foo 3 bar", resolve("foo \#{1 + 2} bar")
|
122
|
-
assert_equal "foo 35 bar", resolve("foo \#{1 + 2}\#{2 + 3} bar")
|
123
|
-
assert_equal "foo 3 5 bar", resolve("foo \#{1 + 2} \#{2 + 3} bar")
|
124
|
-
assert_equal "3bar", resolve("\#{1 + 2}bar")
|
125
|
-
assert_equal "foo3", resolve("foo\#{1 + 2}")
|
126
|
-
assert_equal "3", resolve("\#{1 + 2}")
|
127
|
-
end
|
128
|
-
|
129
|
-
def test_interpolation_in_function
|
130
|
-
assert_equal 'flabnabbit(1foo)', resolve('flabnabbit(#{1 + "foo"})')
|
131
|
-
assert_equal 'flabnabbit(foo 1foobaz)', resolve('flabnabbit(foo #{1 + "foo"}baz)')
|
132
|
-
assert_equal('flabnabbit(foo 1foo2bar baz)',
|
133
|
-
resolve('flabnabbit(foo #{1 + "foo"}#{2 + "bar"} baz)'))
|
134
|
-
end
|
135
|
-
|
136
|
-
def test_interpolation_near_operators
|
137
|
-
assert_equal '3 , 7', resolve('#{1 + 2} , #{3 + 4}')
|
138
|
-
assert_equal '3, 7', resolve('#{1 + 2}, #{3 + 4}')
|
139
|
-
assert_equal '3 ,7', resolve('#{1 + 2} ,#{3 + 4}')
|
140
|
-
assert_equal '3,7', resolve('#{1 + 2},#{3 + 4}')
|
141
|
-
assert_equal '3, 7, 11', resolve('#{1 + 2}, #{3 + 4}, #{5 + 6}')
|
142
|
-
assert_equal '3, 7, 11', resolve('3, #{3 + 4}, 11')
|
143
|
-
|
144
|
-
assert_equal '3 / 7', resolve('3 / #{3 + 4}')
|
145
|
-
assert_equal '3 /7', resolve('3 /#{3 + 4}')
|
146
|
-
assert_equal '3/ 7', resolve('3/ #{3 + 4}')
|
147
|
-
assert_equal '3/7', resolve('3/#{3 + 4}')
|
148
|
-
|
149
|
-
assert_equal '3 * 7', resolve('#{1 + 2} * 7')
|
150
|
-
assert_equal '3* 7', resolve('#{1 + 2}* 7')
|
151
|
-
assert_equal '3 *7', resolve('#{1 + 2} *7')
|
152
|
-
assert_equal '3*7', resolve('#{1 + 2}*7')
|
153
|
-
|
154
|
-
assert_equal '-3', resolve('-#{1 + 2}')
|
155
|
-
assert_equal '- 3', resolve('- #{1 + 2}')
|
156
|
-
|
157
|
-
assert_equal '5 + 3 * 7', resolve('5 + #{1 + 2} * #{3 + 4}')
|
158
|
-
assert_equal '5 +3 * 7', resolve('5 +#{1 + 2} * #{3 + 4}')
|
159
|
-
assert_equal '5+3 * 7', resolve('5+#{1 + 2} * #{3 + 4}')
|
160
|
-
assert_equal '3 * 7 + 5', resolve('#{1 + 2} * #{3 + 4} + 5')
|
161
|
-
assert_equal '3 * 7+ 5', resolve('#{1 + 2} * #{3 + 4}+ 5')
|
162
|
-
assert_equal '3 * 7+5', resolve('#{1 + 2} * #{3 + 4}+5')
|
163
|
-
|
164
|
-
assert_equal '5/3 + 7', resolve('5 / (#{1 + 2} + #{3 + 4})')
|
165
|
-
assert_equal '5/3 + 7', resolve('5 /(#{1 + 2} + #{3 + 4})')
|
166
|
-
assert_equal '5/3 + 7', resolve('5 /( #{1 + 2} + #{3 + 4} )')
|
167
|
-
assert_equal '3 + 7/5', resolve('(#{1 + 2} + #{3 + 4}) / 5')
|
168
|
-
assert_equal '3 + 7/5', resolve('(#{1 + 2} + #{3 + 4})/ 5')
|
169
|
-
assert_equal '3 + 7/5', resolve('( #{1 + 2} + #{3 + 4} )/ 5')
|
170
|
-
|
171
|
-
assert_equal '3 + 5', resolve('#{1 + 2} + 2 + 3')
|
172
|
-
assert_equal '3 +5', resolve('#{1 + 2} +2 + 3')
|
173
|
-
end
|
174
|
-
|
175
|
-
def test_string_interpolation
|
176
|
-
assert_equal "foo bar, baz bang", resolve('"foo #{"bar"}, #{"baz"} bang"')
|
177
|
-
assert_equal "foo bar baz bang", resolve('"foo #{"#{"ba" + "r"} baz"} bang"')
|
178
|
-
assert_equal 'foo #{bar baz} bang', resolve('"foo \#{#{"ba" + "r"} baz} bang"')
|
179
|
-
assert_equal 'foo #{baz bang', resolve('"foo #{"\#{" + "baz"} bang"')
|
180
|
-
end
|
181
|
-
|
182
|
-
def test_rule_interpolation
|
183
|
-
assert_equal(<<CSS, render(<<SASS))
|
184
|
-
foo bar baz bang {
|
185
|
-
a: b; }
|
186
|
-
CSS
|
187
|
-
foo \#{"\#{"ba" + "r"} baz"} bang
|
188
|
-
a: b
|
189
|
-
SASS
|
190
|
-
assert_equal(<<CSS, render(<<SASS))
|
191
|
-
foo [bar="\#{bar baz}"] bang {
|
192
|
-
a: b; }
|
193
|
-
CSS
|
194
|
-
foo [bar="\\\#{\#{"ba" + "r"} baz}"] bang
|
195
|
-
a: b
|
196
|
-
SASS
|
197
|
-
assert_equal(<<CSS, render(<<SASS))
|
198
|
-
foo [bar="\#{baz"] bang {
|
199
|
-
a: b; }
|
200
|
-
CSS
|
201
|
-
foo [bar="\#{"\\\#{" + "baz"}"] bang
|
202
|
-
a: b
|
203
|
-
SASS
|
204
|
-
end
|
205
|
-
|
206
|
-
def test_inaccessible_functions
|
207
|
-
assert_equal "send(to_s)", resolve("send(to_s)", :line => 2)
|
208
|
-
assert_equal "public_instance_methods()", resolve("public_instance_methods()")
|
209
|
-
end
|
210
|
-
|
211
|
-
def test_adding_functions_directly_to_functions_module
|
212
|
-
assert !Functions.callable?('nonexistant')
|
213
|
-
Functions.class_eval { def nonexistant; end }
|
214
|
-
assert Functions.callable?('nonexistant')
|
215
|
-
Functions.send :remove_method, :nonexistant
|
216
|
-
end
|
217
|
-
|
218
|
-
def test_default_functions
|
219
|
-
assert_equal "url(12)", resolve("url(12)")
|
220
|
-
assert_equal 'blam("foo")', resolve('blam("foo")')
|
221
|
-
end
|
222
|
-
|
223
|
-
def test_function_results_have_options
|
224
|
-
assert_equal "Options defined!", resolve("assert_options(abs(1))")
|
225
|
-
assert_equal "Options defined!", resolve("assert_options(round(1.2))")
|
226
|
-
end
|
227
|
-
|
228
|
-
def test_funcall_requires_no_whitespace_before_lparen
|
229
|
-
assert_equal "no-repeat 15px", resolve("no-repeat (7px + 8px)")
|
230
|
-
assert_equal "no-repeat(15px)", resolve("no-repeat(7px + 8px)")
|
231
|
-
end
|
232
|
-
|
233
|
-
def test_dynamic_url
|
234
|
-
assert_equal "url(foo-bar)", resolve("url($foo)", {}, env('foo' => Sass::Script::String.new("foo-bar")))
|
235
|
-
assert_equal "url(foo-bar baz)", resolve("url($foo $bar)", {}, env('foo' => Sass::Script::String.new("foo-bar"), 'bar' => Sass::Script::String.new("baz")))
|
236
|
-
assert_equal "url(foo baz)", resolve("url(foo $bar)", {}, env('bar' => Sass::Script::String.new("baz")))
|
237
|
-
assert_equal "url(foo bar)", resolve("url(foo bar)")
|
238
|
-
end
|
239
|
-
|
240
|
-
def test_url_with_interpolation
|
241
|
-
assert_equal "url(http://sass-lang.com/images/foo-bar)", resolve("url(http://sass-lang.com/images/\#{foo-bar})")
|
242
|
-
assert_equal 'url("http://sass-lang.com/images/foo-bar")', resolve("url('http://sass-lang.com/images/\#{foo-bar}')")
|
243
|
-
assert_equal 'url("http://sass-lang.com/images/foo-bar")', resolve('url("http://sass-lang.com/images/#{foo-bar}")')
|
244
|
-
assert_unquoted "url(http://sass-lang.com/images/\#{foo-bar})"
|
245
|
-
end
|
246
|
-
|
247
|
-
def test_hyphenated_variables
|
248
|
-
assert_equal("a-b", resolve("$a-b", {}, env("a-b" => Sass::Script::String.new("a-b"))))
|
249
|
-
end
|
250
|
-
|
251
|
-
def test_ruby_equality
|
252
|
-
assert_equal eval('"foo"'), eval('"foo"')
|
253
|
-
assert_equal eval('1'), eval('1.0')
|
254
|
-
assert_equal eval('1 2 3.0'), eval('1 2 3')
|
255
|
-
assert_equal eval('1, 2, 3.0'), eval('1, 2, 3')
|
256
|
-
assert_equal eval('(1 2), (3, 4), (5 6)'), eval('(1 2), (3, 4), (5 6)')
|
257
|
-
assert_not_equal eval('1, 2, 3'), eval('1 2 3')
|
258
|
-
assert_not_equal eval('1'), eval('"1"')
|
259
|
-
end
|
260
|
-
|
261
|
-
def test_booleans
|
262
|
-
assert_equal "true", resolve("true")
|
263
|
-
assert_equal "false", resolve("false")
|
264
|
-
end
|
265
|
-
|
266
|
-
def test_boolean_ops
|
267
|
-
assert_equal "true", resolve("true and true")
|
268
|
-
assert_equal "true", resolve("false or true")
|
269
|
-
assert_equal "true", resolve("true or false")
|
270
|
-
assert_equal "true", resolve("true or true")
|
271
|
-
assert_equal "false", resolve("false or false")
|
272
|
-
assert_equal "false", resolve("false and true")
|
273
|
-
assert_equal "false", resolve("true and false")
|
274
|
-
assert_equal "false", resolve("false and false")
|
275
|
-
|
276
|
-
assert_equal "true", resolve("not false")
|
277
|
-
assert_equal "false", resolve("not true")
|
278
|
-
assert_equal "true", resolve("not not true")
|
279
|
-
|
280
|
-
assert_equal "1", resolve("false or 1")
|
281
|
-
assert_equal "false", resolve("false and 1")
|
282
|
-
assert_equal "2", resolve("2 or 3")
|
283
|
-
assert_equal "3", resolve("2 and 3")
|
284
|
-
end
|
285
|
-
|
286
|
-
def test_arithmetic_ops
|
287
|
-
assert_equal "2", resolve("1 + 1")
|
288
|
-
assert_equal "0", resolve("1 - 1")
|
289
|
-
assert_equal "8", resolve("2 * 4")
|
290
|
-
assert_equal "0.5", resolve("(2 / 4)")
|
291
|
-
assert_equal "2", resolve("(4 / 2)")
|
292
|
-
|
293
|
-
assert_equal "-1", resolve("-1")
|
294
|
-
end
|
295
|
-
|
296
|
-
def test_string_ops
|
297
|
-
assert_equal '"foo" "bar"', resolve('"foo" "bar"')
|
298
|
-
assert_equal "true 1", resolve('true 1')
|
299
|
-
assert_equal '"foo", "bar"', resolve("'foo' , 'bar'")
|
300
|
-
assert_equal "true, 1", resolve('true , 1')
|
301
|
-
assert_equal "foobar", resolve('"foo" + "bar"')
|
302
|
-
assert_equal "true1", resolve('true + 1')
|
303
|
-
assert_equal '"foo"-"bar"', resolve("'foo' - 'bar'")
|
304
|
-
assert_equal "true-1", resolve('true - 1')
|
305
|
-
assert_equal '"foo"/"bar"', resolve('"foo" / "bar"')
|
306
|
-
assert_equal "true/1", resolve('true / 1')
|
307
|
-
|
308
|
-
assert_equal '-"bar"', resolve("- 'bar'")
|
309
|
-
assert_equal "-true", resolve('- true')
|
310
|
-
assert_equal '/"bar"', resolve('/ "bar"')
|
311
|
-
assert_equal "/true", resolve('/ true')
|
312
|
-
end
|
313
|
-
|
314
|
-
def test_relational_ops
|
315
|
-
assert_equal "false", resolve("1 > 2")
|
316
|
-
assert_equal "false", resolve("2 > 2")
|
317
|
-
assert_equal "true", resolve("3 > 2")
|
318
|
-
assert_equal "false", resolve("1 >= 2")
|
319
|
-
assert_equal "true", resolve("2 >= 2")
|
320
|
-
assert_equal "true", resolve("3 >= 2")
|
321
|
-
assert_equal "true", resolve("1 < 2")
|
322
|
-
assert_equal "false", resolve("2 < 2")
|
323
|
-
assert_equal "false", resolve("3 < 2")
|
324
|
-
assert_equal "true", resolve("1 <= 2")
|
325
|
-
assert_equal "true", resolve("2 <= 2")
|
326
|
-
assert_equal "false", resolve("3 <= 2")
|
327
|
-
end
|
328
|
-
|
329
|
-
def test_equals
|
330
|
-
assert_equal("true", resolve('"foo" == $foo', {},
|
331
|
-
env("foo" => Sass::Script::String.new("foo"))))
|
332
|
-
assert_equal "true", resolve("1 == 1.0")
|
333
|
-
assert_equal "true", resolve("false != true")
|
334
|
-
assert_equal "false", resolve("1em == 1px")
|
335
|
-
assert_equal "false", resolve("12 != 12")
|
336
|
-
assert_equal "true", resolve("(foo bar baz) == (foo bar baz)")
|
337
|
-
assert_equal "true", resolve("(foo, bar, baz) == (foo, bar, baz)")
|
338
|
-
assert_equal "true", resolve('((1 2), (3, 4), (5 6)) == ((1 2), (3, 4), (5 6))')
|
339
|
-
assert_equal "true", resolve('((1 2), (3 4)) == (1 2, 3 4)')
|
340
|
-
assert_equal "false", resolve('((1 2) 3) == (1 2 3)')
|
341
|
-
assert_equal "false", resolve('(1 (2 3)) == (1 2 3)')
|
342
|
-
assert_equal "false", resolve('((1, 2) (3, 4)) == (1, 2 3, 4)')
|
343
|
-
assert_equal "false", resolve('(1 2 3) == (1, 2, 3)')
|
344
|
-
end
|
345
|
-
|
346
|
-
def test_operation_precedence
|
347
|
-
assert_equal "false true", resolve("true and false false or true")
|
348
|
-
assert_equal "true", resolve("false and true or true and true")
|
349
|
-
assert_equal "true", resolve("1 == 2 or 3 == 3")
|
350
|
-
assert_equal "true", resolve("1 < 2 == 3 >= 3")
|
351
|
-
assert_equal "true", resolve("1 + 3 > 4 - 2")
|
352
|
-
assert_equal "11", resolve("1 + 2 * 3 + 4")
|
353
|
-
end
|
354
|
-
|
355
|
-
def test_functions
|
356
|
-
assert_equal "#80ff80", resolve("hsl(120, 100%, 75%)")
|
357
|
-
assert_equal "#81ff81", resolve("hsl(120, 100%, 75%) + #010001")
|
358
|
-
end
|
359
|
-
|
360
|
-
def test_operator_unit_conversion
|
361
|
-
assert_equal "1.1cm", resolve("1cm + 1mm")
|
362
|
-
assert_equal "true", resolve("2mm < 1cm")
|
363
|
-
assert_equal "true", resolve("10mm == 1cm")
|
364
|
-
assert_equal "true", resolve("1 == 1cm")
|
365
|
-
assert_equal "true", resolve("1.1cm == 11mm")
|
366
|
-
end
|
367
|
-
|
368
|
-
def test_operations_have_options
|
369
|
-
assert_equal "Options defined!", resolve("assert_options(1 + 1)")
|
370
|
-
assert_equal "Options defined!", resolve("assert_options('bar' + 'baz')")
|
371
|
-
end
|
372
|
-
|
373
|
-
def test_slash_compiles_literally_when_left_alone
|
374
|
-
assert_equal "1px/2px", resolve("1px/2px")
|
375
|
-
assert_equal "1px/2px/3px/4px", resolve("1px/2px/3px/4px")
|
376
|
-
|
377
|
-
assert_equal "1px/2px redpx bluepx", resolve("1px/2px redpx bluepx")
|
378
|
-
assert_equal "foo 1px/2px/3px bar", resolve("foo 1px/2px/3px bar")
|
379
|
-
end
|
380
|
-
|
381
|
-
def test_slash_divides_with_parens
|
382
|
-
assert_equal "0.5", resolve("(1px/2px)")
|
383
|
-
assert_equal "0.5", resolve("(1px)/2px")
|
384
|
-
assert_equal "0.5", resolve("1px/(2px)")
|
385
|
-
end
|
386
|
-
|
387
|
-
def test_slash_divides_with_other_arithmetic
|
388
|
-
assert_equal "0.5px", resolve("1px*1px/2px")
|
389
|
-
assert_equal "0.5px", resolve("1px/2px*1px")
|
390
|
-
assert_equal "0.5", resolve("0+1px/2px")
|
391
|
-
assert_equal "0.5", resolve("1px/2px+0")
|
392
|
-
end
|
393
|
-
|
394
|
-
def test_slash_divides_with_variable
|
395
|
-
assert_equal "0.5", resolve("$var/2px", {}, env("var" => eval("1px")))
|
396
|
-
assert_equal "0.5", resolve("1px/$var", {}, env("var" => eval("2px")))
|
397
|
-
assert_equal "0.5", resolve("$var", {}, env("var" => eval("1px/2px")))
|
398
|
-
end
|
399
|
-
|
400
|
-
def test_colors_with_wrong_number_of_digits
|
401
|
-
assert_raise_message(Sass::SyntaxError,
|
402
|
-
"Colors must have either three or six digits: '#0'") {eval("#0")}
|
403
|
-
assert_raise_message(Sass::SyntaxError,
|
404
|
-
"Colors must have either three or six digits: '#12'") {eval("#12")}
|
405
|
-
assert_raise_message(Sass::SyntaxError,
|
406
|
-
"Colors must have either three or six digits: '#abcd'") {eval("#abcd")}
|
407
|
-
assert_raise_message(Sass::SyntaxError,
|
408
|
-
"Colors must have either three or six digits: '#abcdE'") {eval("#abcdE")}
|
409
|
-
assert_raise_message(Sass::SyntaxError,
|
410
|
-
"Colors must have either three or six digits: '#abcdEFA'") {eval("#abcdEFA")}
|
411
|
-
end
|
412
|
-
|
413
|
-
def test_case_insensitive_color_names
|
414
|
-
assert_equal "blue", resolve("BLUE")
|
415
|
-
assert_equal "red", resolve("rEd")
|
416
|
-
assert_equal "#7f4000", resolve("mix(GrEeN, ReD)")
|
417
|
-
end
|
418
|
-
|
419
|
-
def test_empty_list
|
420
|
-
assert_equal "1 2 3", resolve("1 2 () 3")
|
421
|
-
assert_equal "1 2 3", resolve("1 2 3 ()")
|
422
|
-
assert_equal "1 2 3", resolve("() 1 2 3")
|
423
|
-
assert_raise_message(Sass::SyntaxError, "() isn't a valid CSS value.") {resolve("()")}
|
424
|
-
assert_raise_message(Sass::SyntaxError, "() isn't a valid CSS value.") {resolve("nth(append((), ()), 1)")}
|
425
|
-
end
|
426
|
-
|
427
|
-
def test_deep_argument_error_not_unwrapped
|
428
|
-
assert_raise_message(ArgumentError, 'wrong number of arguments (0 for 1)') {resolve("arg-error()")}
|
429
|
-
end
|
430
|
-
|
431
|
-
def test_shallow_argument_error_unwrapped
|
432
|
-
assert_raise_message(Sass::SyntaxError, "wrong number of arguments (1 for 0) for `arg-error'") {resolve("arg-error(1)")}
|
433
|
-
end
|
434
|
-
|
435
|
-
# Regression Tests
|
436
|
-
|
437
|
-
def test_funcall_has_higher_precedence_than_color_name
|
438
|
-
assert_equal "teal(12)", resolve("teal(12)")
|
439
|
-
assert_equal "tealbang(12)", resolve("tealbang(12)")
|
440
|
-
assert_equal "teal-bang(12)", resolve("teal-bang(12)")
|
441
|
-
assert_equal "teal\\+bang(12)", resolve("teal\\+bang(12)")
|
442
|
-
end
|
443
|
-
|
444
|
-
def test_interpolation_after_hash
|
445
|
-
assert_equal "#2", resolve('"##{1 + 1}"')
|
446
|
-
end
|
447
|
-
|
448
|
-
def test_misplaced_comma_in_funcall
|
449
|
-
assert_raise_message(Sass::SyntaxError,
|
450
|
-
'Invalid CSS after "foo(bar, ": expected function argument, was ")"') {eval('foo(bar, )')}
|
451
|
-
end
|
452
|
-
|
453
|
-
def test_color_prefixed_identifier
|
454
|
-
assert_equal "tealbang", resolve("tealbang")
|
455
|
-
assert_equal "teal-bang", resolve("teal-bang")
|
456
|
-
end
|
457
|
-
|
458
|
-
def test_op_prefixed_identifier
|
459
|
-
assert_equal "notbang", resolve("notbang")
|
460
|
-
assert_equal "not-bang", resolve("not-bang")
|
461
|
-
assert_equal "or-bang", resolve("or-bang")
|
462
|
-
assert_equal "and-bang", resolve("and-bang")
|
463
|
-
end
|
464
|
-
|
465
|
-
private
|
466
|
-
|
467
|
-
def resolve(str, opts = {}, environment = env)
|
468
|
-
munge_filename opts
|
469
|
-
val = eval(str, opts, environment)
|
470
|
-
val.is_a?(Sass::Script::String) ? val.value : val.to_s
|
471
|
-
end
|
472
|
-
|
473
|
-
def assert_unquoted(str, opts = {}, environment = env)
|
474
|
-
munge_filename opts
|
475
|
-
val = eval(str, opts, environment)
|
476
|
-
assert_kind_of Sass::Script::String, val
|
477
|
-
assert_equal :identifier, val.type
|
478
|
-
end
|
479
|
-
|
480
|
-
def assert_quoted(str, opts = {}, environment = env)
|
481
|
-
munge_filename opts
|
482
|
-
val = eval(str, opts, environment)
|
483
|
-
assert_kind_of Sass::Script::String, val
|
484
|
-
assert_equal :string, val.type
|
485
|
-
end
|
486
|
-
|
487
|
-
def eval(str, opts = {}, environment = env)
|
488
|
-
munge_filename opts
|
489
|
-
environment.options = opts
|
490
|
-
Sass::Script.parse(str, opts.delete(:line) || 1,
|
491
|
-
opts.delete(:offset) || 0, opts).perform(environment)
|
492
|
-
end
|
493
|
-
|
494
|
-
def render(sass, options = {})
|
495
|
-
munge_filename options
|
496
|
-
Sass::Engine.new(sass, options).render
|
497
|
-
end
|
498
|
-
|
499
|
-
def env(hash = {})
|
500
|
-
env = Sass::Environment.new
|
501
|
-
hash.each {|k, v| env.set_var(k, v)}
|
502
|
-
env
|
503
|
-
end
|
504
|
-
|
505
|
-
def test_number_printing
|
506
|
-
assert_equal "1", eval("1")
|
507
|
-
assert_equal "1", eval("1.0")
|
508
|
-
assert_equal "1.121", eval("1.1214")
|
509
|
-
assert_equal "1.122", eval("1.1215")
|
510
|
-
assert_equal "Infinity", eval("1.0/0.0")
|
511
|
-
assert_equal "-Infinity", eval("-1.0/0.0")
|
512
|
-
assert_equal "NaN", eval("0.0/0.0")
|
513
|
-
end
|
514
|
-
end
|