compass-sass37 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.markdown +1 -0
- data/Rakefile +237 -0
- data/VERSION +1 -0
- data/VERSION_NAME +1 -0
- data/bin/compass +45 -0
- data/features/command_line.feature +195 -0
- data/features/extensions.feature +27 -0
- data/features/step_definitions/command_line_steps.rb +268 -0
- data/features/step_definitions/extension_steps.rb +24 -0
- data/lib/compass/actions.rb +116 -0
- data/lib/compass/app_integration/stand_alone/configuration_defaults.rb +32 -0
- data/lib/compass/app_integration/stand_alone/installer.rb +83 -0
- data/lib/compass/app_integration/stand_alone.rb +22 -0
- data/lib/compass/app_integration.rb +39 -0
- data/lib/compass/commands/base.rb +44 -0
- data/lib/compass/commands/clean_project.rb +79 -0
- data/lib/compass/commands/create_project.rb +131 -0
- data/lib/compass/commands/default.rb +50 -0
- data/lib/compass/commands/extension_command.rb +60 -0
- data/lib/compass/commands/help.rb +85 -0
- data/lib/compass/commands/imports.rb +35 -0
- data/lib/compass/commands/installer_command.rb +32 -0
- data/lib/compass/commands/interactive.rb +61 -0
- data/lib/compass/commands/list_frameworks.rb +39 -0
- data/lib/compass/commands/print_version.rb +88 -0
- data/lib/compass/commands/project_base.rb +103 -0
- data/lib/compass/commands/project_stats.rb +178 -0
- data/lib/compass/commands/project_structure.rb +93 -0
- data/lib/compass/commands/registry.rb +40 -0
- data/lib/compass/commands/sprite.rb +89 -0
- data/lib/compass/commands/stamp_pattern.rb +90 -0
- data/lib/compass/commands/unpack_extension.rb +120 -0
- data/lib/compass/commands/update_project.rb +148 -0
- data/lib/compass/commands/validate_project.rb +77 -0
- data/lib/compass/commands/watch_project.rb +117 -0
- data/lib/compass/commands/write_configuration.rb +125 -0
- data/lib/compass/commands.rb +14 -0
- data/lib/compass/compiler.rb +249 -0
- data/lib/compass/configuration/comments.rb +62 -0
- data/lib/compass/configuration/file_data.rb +21 -0
- data/lib/compass/configuration/helpers.rb +113 -0
- data/lib/compass/configuration/serialization.rb +95 -0
- data/lib/compass/dependencies.rb +12 -0
- data/lib/compass/deprecation.rb +19 -0
- data/lib/compass/errors.rb +9 -0
- data/lib/compass/exec/command_option_parser.rb +23 -0
- data/lib/compass/exec/global_options_parser.rb +59 -0
- data/lib/compass/exec/helpers.rb +21 -0
- data/lib/compass/exec/project_options_parser.rb +74 -0
- data/lib/compass/exec/sub_command_ui.rb +51 -0
- data/lib/compass/exec.rb +23 -0
- data/lib/compass/generated_version.rb +4 -0
- data/lib/compass/installers/bare_installer.rb +58 -0
- data/lib/compass/installers/base.rb +187 -0
- data/lib/compass/installers/manifest.rb +161 -0
- data/lib/compass/installers/manifest_installer.rb +61 -0
- data/lib/compass/installers/template_context.rb +44 -0
- data/lib/compass/installers.rb +3 -0
- data/lib/compass/logger.rb +140 -0
- data/lib/compass/quick_cache.rb +15 -0
- data/lib/compass/rails.rb +2 -0
- data/lib/compass/sass_compiler.rb +152 -0
- data/lib/compass/sass_extensions/functions/sprites.rb +305 -0
- data/lib/compass/sass_extensions/functions.rb +15 -0
- data/lib/compass/sass_extensions/sprites/engines/chunky_png_engine.rb +35 -0
- data/lib/compass/sass_extensions/sprites/engines.rb +25 -0
- data/lib/compass/sass_extensions/sprites/image.rb +162 -0
- data/lib/compass/sass_extensions/sprites/image_methods.rb +52 -0
- data/lib/compass/sass_extensions/sprites/image_row.rb +47 -0
- data/lib/compass/sass_extensions/sprites/images.rb +29 -0
- data/lib/compass/sass_extensions/sprites/layout/diagonal.rb +42 -0
- data/lib/compass/sass_extensions/sprites/layout/horizontal.rb +66 -0
- data/lib/compass/sass_extensions/sprites/layout/smart.rb +33 -0
- data/lib/compass/sass_extensions/sprites/layout/vertical.rb +68 -0
- data/lib/compass/sass_extensions/sprites/layout.rb +39 -0
- data/lib/compass/sass_extensions/sprites/layout_methods.rb +53 -0
- data/lib/compass/sass_extensions/sprites/row_fitter.rb +92 -0
- data/lib/compass/sass_extensions/sprites/sprite_map.rb +93 -0
- data/lib/compass/sass_extensions/sprites/sprite_methods.rb +136 -0
- data/lib/compass/sass_extensions/sprites.rb +21 -0
- data/lib/compass/sass_extensions.rb +9 -0
- data/lib/compass/sprite_importer/binding.rb +11 -0
- data/lib/compass/sprite_importer/content.erb +87 -0
- data/lib/compass/sprite_importer.rb +117 -0
- data/lib/compass/stats.rb +99 -0
- data/lib/compass/test_case.rb +38 -0
- data/lib/compass/validator.rb +16 -0
- data/lib/compass/version.rb +42 -0
- data/lib/compass.rb +39 -0
- data/test/fixtures/extensions/only_stylesheets/compass_init.rb +1 -0
- data/test/fixtures/extensions/only_stylesheets/scss/only_stylesheets/foo.scss +3 -0
- data/test/fixtures/fonts/bgrove.base64.txt +1 -0
- data/test/fixtures/fonts/bgrove.ttf +0 -0
- data/test/fixtures/sprites/public/images/bad_extensions/ten-by-ten.gif +0 -0
- data/test/fixtures/sprites/public/images/bad_extensions/twenty-by-twenty.jpg +0 -0
- data/test/fixtures/sprites/public/images/bool/false.png +0 -0
- data/test/fixtures/sprites/public/images/bool/true.png +0 -0
- data/test/fixtures/sprites/public/images/colors/blue.png +0 -0
- data/test/fixtures/sprites/public/images/colors/yellow.png +0 -0
- data/test/fixtures/sprites/public/images/focus/ten-by-ten.png +0 -0
- data/test/fixtures/sprites/public/images/focus/ten-by-ten_active.png +0 -0
- data/test/fixtures/sprites/public/images/focus/ten-by-ten_focus.png +0 -0
- data/test/fixtures/sprites/public/images/focus/ten-by-ten_hover.png +0 -0
- data/test/fixtures/sprites/public/images/focus/ten-by-ten_target.png +0 -0
- data/test/fixtures/sprites/public/images/image_row/large.png +0 -0
- data/test/fixtures/sprites/public/images/image_row/large_square.png +0 -0
- data/test/fixtures/sprites/public/images/image_row/medium.png +0 -0
- data/test/fixtures/sprites/public/images/image_row/small.png +0 -0
- data/test/fixtures/sprites/public/images/image_row/tall.png +0 -0
- data/test/fixtures/sprites/public/images/ko/default_background.png +0 -0
- data/test/fixtures/sprites/public/images/ko/starbg26x27.png +0 -0
- data/test/fixtures/sprites/public/images/nested/squares/ten-by-ten.png +0 -0
- data/test/fixtures/sprites/public/images/numeric/200.png +0 -0
- data/test/fixtures/sprites/public/images/prefix/20-by-20.png +0 -0
- data/test/fixtures/sprites/public/images/prefix/ten-by-ten.png +0 -0
- data/test/fixtures/sprites/public/images/repeat_x/five.png +0 -0
- data/test/fixtures/sprites/public/images/repeat_x/four.png +0 -0
- data/test/fixtures/sprites/public/images/repeat_x/one.png +0 -0
- data/test/fixtures/sprites/public/images/repeat_x/three.png +0 -0
- data/test/fixtures/sprites/public/images/repeat_x/two.png +0 -0
- data/test/fixtures/sprites/public/images/selectors/ten-by-ten.png +0 -0
- data/test/fixtures/sprites/public/images/selectors/ten-by-ten_active.png +0 -0
- data/test/fixtures/sprites/public/images/selectors/ten-by-ten_hover.png +0 -0
- data/test/fixtures/sprites/public/images/selectors/ten-by-ten_target.png +0 -0
- data/test/fixtures/sprites/public/images/squares/ten-by-ten.png +0 -0
- data/test/fixtures/sprites/public/images/squares/twenty-by-twenty.png +0 -0
- data/test/fixtures/stylesheets/busted_font_urls/config.rb +32 -0
- data/test/fixtures/stylesheets/busted_font_urls/css/screen.css +9 -0
- data/test/fixtures/stylesheets/busted_font_urls/fonts/feed.ttf +0 -0
- data/test/fixtures/stylesheets/busted_font_urls/fonts/grid.ttf +0 -0
- data/test/fixtures/stylesheets/busted_font_urls/fonts/sub/dk.ttf +0 -0
- data/test/fixtures/stylesheets/busted_font_urls/sass/screen.sass +14 -0
- data/test/fixtures/stylesheets/busted_image_urls/config.rb +29 -0
- data/test/fixtures/stylesheets/busted_image_urls/css/screen.css +9 -0
- data/test/fixtures/stylesheets/busted_image_urls/images/feed.png +0 -0
- data/test/fixtures/stylesheets/busted_image_urls/images/flags/dk.png +0 -0
- data/test/fixtures/stylesheets/busted_image_urls/images/grid.png +0 -0
- data/test/fixtures/stylesheets/busted_image_urls/sass/screen.sass +14 -0
- data/test/fixtures/stylesheets/compass/100x150.jpg +0 -0
- data/test/fixtures/stylesheets/compass/config.rb +18 -0
- data/test/fixtures/stylesheets/compass/css/animation-with-legacy-ie.css +22 -0
- data/test/fixtures/stylesheets/compass/css/animation.css +22 -0
- data/test/fixtures/stylesheets/compass/css/appearance.css +3 -0
- data/test/fixtures/stylesheets/compass/css/background-clip.css +11 -0
- data/test/fixtures/stylesheets/compass/css/background-origin.css +11 -0
- data/test/fixtures/stylesheets/compass/css/background-size.css +17 -0
- data/test/fixtures/stylesheets/compass/css/border_radius.css +14 -0
- data/test/fixtures/stylesheets/compass/css/box-sizing.css +14 -0
- data/test/fixtures/stylesheets/compass/css/box.css +103 -0
- data/test/fixtures/stylesheets/compass/css/box_shadow.css +24 -0
- data/test/fixtures/stylesheets/compass/css/brightness.css +14 -0
- data/test/fixtures/stylesheets/compass/css/browser-support.css +335 -0
- data/test/fixtures/stylesheets/compass/css/color.css +18 -0
- data/test/fixtures/stylesheets/compass/css/columns.css +134 -0
- data/test/fixtures/stylesheets/compass/css/filters.css +53 -0
- data/test/fixtures/stylesheets/compass/css/flexbox.css +94 -0
- data/test/fixtures/stylesheets/compass/css/fonts.css +8 -0
- data/test/fixtures/stylesheets/compass/css/force-wrap.css +9 -0
- data/test/fixtures/stylesheets/compass/css/gradients.css +222 -0
- data/test/fixtures/stylesheets/compass/css/grid_background.css +79 -0
- data/test/fixtures/stylesheets/compass/css/hyphenation.css +16 -0
- data/test/fixtures/stylesheets/compass/css/image_size.css +15 -0
- data/test/fixtures/stylesheets/compass/css/images.css +8 -0
- data/test/fixtures/stylesheets/compass/css/layout.css +16 -0
- data/test/fixtures/stylesheets/compass/css/legacy_clearfix.css +26 -0
- data/test/fixtures/stylesheets/compass/css/lists.css +145 -0
- data/test/fixtures/stylesheets/compass/css/opacity.css +7 -0
- data/test/fixtures/stylesheets/compass/css/print.css +11 -0
- data/test/fixtures/stylesheets/compass/css/regions.css +9 -0
- data/test/fixtures/stylesheets/compass/css/replacement.css +66 -0
- data/test/fixtures/stylesheets/compass/css/reset.css +59 -0
- data/test/fixtures/stylesheets/compass/css/selection.css +50 -0
- data/test/fixtures/stylesheets/compass/css/sprites_with_explicit_separator.css +19 -0
- data/test/fixtures/stylesheets/compass/css/stretching.css +66 -0
- data/test/fixtures/stylesheets/compass/css/support.css +116 -0
- data/test/fixtures/stylesheets/compass/css/text_shadow.css +29 -0
- data/test/fixtures/stylesheets/compass/css/transform.css +341 -0
- data/test/fixtures/stylesheets/compass/css/transition.css +116 -0
- data/test/fixtures/stylesheets/compass/css/typography/links/hover-link.css +4 -0
- data/test/fixtures/stylesheets/compass/css/units.css +34 -0
- data/test/fixtures/stylesheets/compass/css/user-interface.css +52 -0
- data/test/fixtures/stylesheets/compass/css/utilities.css +71 -0
- data/test/fixtures/stylesheets/compass/css/vertical_rhythm.css +42 -0
- data/test/fixtures/stylesheets/compass/css/vertical_rhythm_with_ems.css +53 -0
- data/test/fixtures/stylesheets/compass/css/vertical_rhythm_with_px.css +52 -0
- data/test/fixtures/stylesheets/compass/css/vertical_rhythm_with_rems.css +67 -0
- data/test/fixtures/stylesheets/compass/images/100x150.gif +0 -0
- data/test/fixtures/stylesheets/compass/images/100x150.jpeg +0 -0
- data/test/fixtures/stylesheets/compass/images/100x150.jpg +0 -0
- data/test/fixtures/stylesheets/compass/images/100x150.png +0 -0
- data/test/fixtures/stylesheets/compass/images/4x6.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ad.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ae.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/af.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ag.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ai.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/al.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/am.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/an.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ao.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ar.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/as.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/at.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/au.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/aw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ax.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/az.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ba.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bb.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bd.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/be.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bi.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bj.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bo.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/br.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bs.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/by.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/bz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ca.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/catalonia.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cd.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ch.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ci.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ck.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/co.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cs.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cx.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cy.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/cz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/de.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/dj.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/dk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/dm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/do.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/dz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ec.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ee.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/eg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/eh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/england.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/er.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/es.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/et.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/europeanunion.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fam.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fi.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fj.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fo.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/fr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ga.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gb.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gd.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ge.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gi.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gp.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gq.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gs.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/gy.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/hk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/hm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/hn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/hr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ht.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/hu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/id-2.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ie.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/il.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/in.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/io.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/iq.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ir.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/is.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/it.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/jm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/jo.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/jp.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ke.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ki.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/km.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kp.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ky.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/kz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/la.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lb.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/li.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ls.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/lv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ly.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ma.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/md.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/me.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ml.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mo.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mp.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mq.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ms.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mx.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/my.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/mz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/na.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ne.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ng.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ni.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/no.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/np.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/nz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/om.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pa.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pe.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ph.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ps.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/pw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/py.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/qa.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/re.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ro.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/rs.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ru.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/rw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sa.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sb.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/scotland.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sd.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/se.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sh.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/si.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sj.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/so.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/st.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sy.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/sz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/td.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/th.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tj.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tk.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tl.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/to.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tr.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tv.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/tz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ua.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ug.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/um.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/us.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/uy.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/uz.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/va.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/vc.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ve.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/vg.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/vi.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/vn.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/vu.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/wales.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/wf.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ws.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/ye.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/yt.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/za.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/zm.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag/zw.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag-s5b4f509715.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states/foo.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states/foo_active.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states/foo_focus.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states/foo_hover.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states/foo_target.png +0 -0
- data/test/fixtures/stylesheets/compass/images/flag_states-sc42d7bf926.png +0 -0
- data/test/fixtures/stylesheets/compass/sass/animation-with-legacy-ie.scss +17 -0
- data/test/fixtures/stylesheets/compass/sass/animation.scss +13 -0
- data/test/fixtures/stylesheets/compass/sass/appearance.scss +5 -0
- data/test/fixtures/stylesheets/compass/sass/background-clip.scss +5 -0
- data/test/fixtures/stylesheets/compass/sass/background-origin.scss +5 -0
- data/test/fixtures/stylesheets/compass/sass/background-size.scss +7 -0
- data/test/fixtures/stylesheets/compass/sass/border_radius.scss +5 -0
- data/test/fixtures/stylesheets/compass/sass/box-sizing.scss +11 -0
- data/test/fixtures/stylesheets/compass/sass/box.sass +50 -0
- data/test/fixtures/stylesheets/compass/sass/box_shadow.scss +7 -0
- data/test/fixtures/stylesheets/compass/sass/brightness.scss +12 -0
- data/test/fixtures/stylesheets/compass/sass/browser-support.scss +30 -0
- data/test/fixtures/stylesheets/compass/sass/color.scss +25 -0
- data/test/fixtures/stylesheets/compass/sass/columns.scss +29 -0
- data/test/fixtures/stylesheets/compass/sass/filters.scss +25 -0
- data/test/fixtures/stylesheets/compass/sass/flexbox.scss +88 -0
- data/test/fixtures/stylesheets/compass/sass/fonts.sass +8 -0
- data/test/fixtures/stylesheets/compass/sass/force-wrap.scss +3 -0
- data/test/fixtures/stylesheets/compass/sass/gradients.sass +128 -0
- data/test/fixtures/stylesheets/compass/sass/grid_background.scss +34 -0
- data/test/fixtures/stylesheets/compass/sass/hyphenation.scss +11 -0
- data/test/fixtures/stylesheets/compass/sass/image_size.sass +15 -0
- data/test/fixtures/stylesheets/compass/sass/images.scss +9 -0
- data/test/fixtures/stylesheets/compass/sass/layout.sass +3 -0
- data/test/fixtures/stylesheets/compass/sass/legacy_clearfix.scss +14 -0
- data/test/fixtures/stylesheets/compass/sass/lists.scss +12 -0
- data/test/fixtures/stylesheets/compass/sass/opacity.scss +9 -0
- data/test/fixtures/stylesheets/compass/sass/print.sass +5 -0
- data/test/fixtures/stylesheets/compass/sass/regions.scss +4 -0
- data/test/fixtures/stylesheets/compass/sass/replacement.scss +22 -0
- data/test/fixtures/stylesheets/compass/sass/reset.sass +12 -0
- data/test/fixtures/stylesheets/compass/sass/selection.scss +41 -0
- data/test/fixtures/stylesheets/compass/sass/sprites_with_explicit_separator.scss +11 -0
- data/test/fixtures/stylesheets/compass/sass/stretching.sass +34 -0
- data/test/fixtures/stylesheets/compass/sass/support.scss +174 -0
- data/test/fixtures/stylesheets/compass/sass/text_shadow.scss +12 -0
- data/test/fixtures/stylesheets/compass/sass/transform.scss +87 -0
- data/test/fixtures/stylesheets/compass/sass/transition.scss +21 -0
- data/test/fixtures/stylesheets/compass/sass/typography/links/hover-link.scss +3 -0
- data/test/fixtures/stylesheets/compass/sass/units.scss +50 -0
- data/test/fixtures/stylesheets/compass/sass/user-interface.scss +28 -0
- data/test/fixtures/stylesheets/compass/sass/utilities.scss +33 -0
- data/test/fixtures/stylesheets/compass/sass/vertical_rhythm.scss +60 -0
- data/test/fixtures/stylesheets/compass/sass/vertical_rhythm_with_ems.scss +52 -0
- data/test/fixtures/stylesheets/compass/sass/vertical_rhythm_with_px.scss +50 -0
- data/test/fixtures/stylesheets/compass/sass/vertical_rhythm_with_rems.scss +50 -0
- data/test/fixtures/stylesheets/envtest/config.rb +9 -0
- data/test/fixtures/stylesheets/envtest/css/env.css +10 -0
- data/test/fixtures/stylesheets/envtest/sass/env.scss +19 -0
- data/test/fixtures/stylesheets/error/config.rb +10 -0
- data/test/fixtures/stylesheets/error/sass/screen.sass +2 -0
- data/test/fixtures/stylesheets/image_urls/config.rb +19 -0
- data/test/fixtures/stylesheets/image_urls/css/screen.css +5 -0
- data/test/fixtures/stylesheets/image_urls/images/grid.png +0 -0
- data/test/fixtures/stylesheets/image_urls/sass/screen.sass +8 -0
- data/test/fixtures/stylesheets/relative/assets/images/testing.png +0 -0
- data/test/fixtures/stylesheets/relative/config.rb +10 -0
- data/test/fixtures/stylesheets/relative/css/ie.css +1 -0
- data/test/fixtures/stylesheets/relative/css/print.css +1 -0
- data/test/fixtures/stylesheets/relative/css/screen.css +1 -0
- data/test/fixtures/stylesheets/relative/sass/ie.sass +5 -0
- data/test/fixtures/stylesheets/relative/sass/print.sass +3 -0
- data/test/fixtures/stylesheets/relative/sass/screen.sass +2 -0
- data/test/fixtures/stylesheets/sourcemaps/config.rb +10 -0
- data/test/fixtures/stylesheets/sourcemaps/css/another_simple.css +2 -0
- data/test/fixtures/stylesheets/sourcemaps/css/another_simple.css.map +7 -0
- data/test/fixtures/stylesheets/sourcemaps/css/simple.css +2 -0
- data/test/fixtures/stylesheets/sourcemaps/css/simple.css.map +7 -0
- data/test/fixtures/stylesheets/sourcemaps/css/with_libraries.css +2 -0
- data/test/fixtures/stylesheets/sourcemaps/css/with_libraries.css.map +7 -0
- data/test/fixtures/stylesheets/sourcemaps/sass/another_simple.scss +3 -0
- data/test/fixtures/stylesheets/sourcemaps/sass/simple.sass +2 -0
- data/test/fixtures/stylesheets/sourcemaps/sass/with_libraries.scss +5 -0
- data/test/fixtures/stylesheets/uses_only_stylesheets_ext/config.rb +25 -0
- data/test/fixtures/stylesheets/uses_only_stylesheets_ext/sass/ie.scss +5 -0
- data/test/fixtures/stylesheets/uses_only_stylesheets_ext/sass/print.scss +3 -0
- data/test/fixtures/stylesheets/uses_only_stylesheets_ext/sass/screen.scss +6 -0
- data/test/fixtures/stylesheets/uses_only_stylesheets_ext/stylesheets/ie.css +5 -0
- data/test/fixtures/stylesheets/uses_only_stylesheets_ext/stylesheets/print.css +3 -0
- data/test/fixtures/stylesheets/uses_only_stylesheets_ext/stylesheets/screen.css +68 -0
- data/test/fixtures/stylesheets/valid/config.rb +9 -0
- data/test/fixtures/stylesheets/valid/sass/another_simple.scss +3 -0
- data/test/fixtures/stylesheets/valid/sass/simple.sass +2 -0
- data/test/fixtures/stylesheets/with_sass_globbing/config.rb +26 -0
- data/test/fixtures/stylesheets/with_sass_globbing/css/screen.css +19 -0
- data/test/fixtures/stylesheets/with_sass_globbing/sass/partials/_1.scss +3 -0
- data/test/fixtures/stylesheets/with_sass_globbing/sass/partials/_2.scss +3 -0
- data/test/fixtures/stylesheets/with_sass_globbing/sass/partials/_3.scss +4 -0
- data/test/fixtures/stylesheets/with_sass_globbing/sass/screen.scss +3 -0
- data/test/helpers/command_line.rb +114 -0
- data/test/helpers/diff.rb +49 -0
- data/test/helpers/io.rb +36 -0
- data/test/helpers/rails.rb +55 -0
- data/test/helpers/test_case.rb +62 -0
- data/test/integrations/compass_test.rb +259 -0
- data/test/integrations/sprites_test.rb +1123 -0
- data/test/test_helper.rb +67 -0
- data/test/units/actions_test.rb +24 -0
- data/test/units/caniuse_test.rb +194 -0
- data/test/units/command_line_test.rb +60 -0
- data/test/units/compass_util_test.rb +11 -0
- data/test/units/compiler_test.rb +16 -0
- data/test/units/configuration_test.rb +618 -0
- data/test/units/regressions_test.rb +35 -0
- data/test/units/sass_extensions_test.rb +232 -0
- data/test/units/sass_extenstions/gradients_test.rb +30 -0
- data/test/units/sprites/engine_test.rb +48 -0
- data/test/units/sprites/image_row_test.rb +58 -0
- data/test/units/sprites/image_test.rb +116 -0
- data/test/units/sprites/images_test.rb +46 -0
- data/test/units/sprites/importer_test.rb +91 -0
- data/test/units/sprites/layout_test.rb +180 -0
- data/test/units/sprites/row_fitter_test.rb +66 -0
- data/test/units/sprites/sprite_command_test.rb +55 -0
- data/test/units/sprites/sprite_map_test.rb +169 -0
- metadata +1175 -0
|
@@ -0,0 +1,618 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
require 'compass'
|
|
3
|
+
require 'stringio'
|
|
4
|
+
|
|
5
|
+
class ConfigurationTest < Test::Unit::TestCase
|
|
6
|
+
|
|
7
|
+
setup do
|
|
8
|
+
Compass.reset_configuration!
|
|
9
|
+
@original_wd = Dir.pwd
|
|
10
|
+
FileUtils.rm_rf "test_tmp"
|
|
11
|
+
FileUtils.mkdir_p "test_tmp/images"
|
|
12
|
+
FileUtils.mkdir_p "test_tmp/fonts"
|
|
13
|
+
Dir.chdir "test_tmp"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
after do
|
|
17
|
+
Compass.reset_configuration!
|
|
18
|
+
Dir.chdir @original_wd
|
|
19
|
+
FileUtils.rm_rf "test_tmp"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def test_parse_and_serialize
|
|
23
|
+
contents = StringIO.new(<<-CONFIG)
|
|
24
|
+
require 'compass'
|
|
25
|
+
require 'compass/import-once/activate'
|
|
26
|
+
# Require any additional compass plugins here.
|
|
27
|
+
|
|
28
|
+
project_type = :stand_alone
|
|
29
|
+
|
|
30
|
+
http_path = "/"
|
|
31
|
+
css_dir = "css"
|
|
32
|
+
sass_dir = "sass"
|
|
33
|
+
images_dir = "img"
|
|
34
|
+
javascripts_dir = "js"
|
|
35
|
+
|
|
36
|
+
output_style = :nested
|
|
37
|
+
|
|
38
|
+
# To enable relative paths to assets via compass helper functions. Uncomment:
|
|
39
|
+
# relative_assets = true
|
|
40
|
+
|
|
41
|
+
# To disable debugging comments that display the original location of your selectors. Uncomment:
|
|
42
|
+
# line_comments = false
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
# If you prefer the indented syntax, you might want to regenerate this
|
|
46
|
+
# project again passing --syntax sass, or you can uncomment this:
|
|
47
|
+
# preferred_syntax = :sass
|
|
48
|
+
# and then run:
|
|
49
|
+
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
|
|
50
|
+
CONFIG
|
|
51
|
+
|
|
52
|
+
Compass.add_configuration(contents, "test_parse")
|
|
53
|
+
|
|
54
|
+
assert_equal 'sass', Compass.configuration.sass_dir
|
|
55
|
+
assert_equal 'css', Compass.configuration.css_dir
|
|
56
|
+
assert_equal 'img', Compass.configuration.images_dir
|
|
57
|
+
assert_equal 'js', Compass.configuration.javascripts_dir
|
|
58
|
+
|
|
59
|
+
expected_lines = contents.string.split("\n").map{|l|l.strip}
|
|
60
|
+
actual_lines = Compass.configuration.serialize.split("\n").map{|l|l.strip}
|
|
61
|
+
assert_correct expected_lines, actual_lines
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def test_custom_watch
|
|
65
|
+
contents = StringIO.new(<<-CONFIG)
|
|
66
|
+
watch 'img/**/*' do
|
|
67
|
+
puts 'foobar'
|
|
68
|
+
end
|
|
69
|
+
CONFIG
|
|
70
|
+
Compass.add_configuration(contents, 'test_watch_config')
|
|
71
|
+
watch = Compass.configuration.watches.first
|
|
72
|
+
assert_equal 'img/**/*', watch.glob
|
|
73
|
+
assert watch.is_a?(Compass::Configuration::Watch)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def test_serialization_warns_with_asset_host_set
|
|
77
|
+
contents = StringIO.new(<<-CONFIG)
|
|
78
|
+
asset_host do |path|
|
|
79
|
+
"http://example.com"
|
|
80
|
+
end
|
|
81
|
+
CONFIG
|
|
82
|
+
|
|
83
|
+
Compass.add_configuration(contents, "test_serialization_warns_with_asset_host_set")
|
|
84
|
+
|
|
85
|
+
warning = capture_warning do
|
|
86
|
+
Compass.configuration.serialize
|
|
87
|
+
end
|
|
88
|
+
assert_equal "WARNING: asset_host is code and cannot be written to a file. You'll need to copy it yourself.\n", warning
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
class TestData < Compass::Configuration::FileData
|
|
92
|
+
def initialize
|
|
93
|
+
super(:test)
|
|
94
|
+
end
|
|
95
|
+
inherited_array :stuff, :clobbers => true
|
|
96
|
+
inherited_array :accumulated
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def test_accumulated_array_does_not_clobber
|
|
100
|
+
data1 = TestData.new
|
|
101
|
+
data1.accumulated = [:a]
|
|
102
|
+
data2 = TestData.new
|
|
103
|
+
data2.accumulated = [:b]
|
|
104
|
+
data2.inherit_from!(data1)
|
|
105
|
+
assert_equal [:b, :a], data2.accumulated.to_a
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
def test_inherited_array_can_clobber
|
|
109
|
+
data1 = TestData.new
|
|
110
|
+
data1.stuff = [:a]
|
|
111
|
+
data2 = TestData.new
|
|
112
|
+
data2.stuff = [:b]
|
|
113
|
+
data2.inherit_from!(data1)
|
|
114
|
+
assert_equal [:b], data2.stuff.to_a
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
def test_inherited_array_can_append
|
|
118
|
+
data1 = TestData.new
|
|
119
|
+
data1.stuff = [:a]
|
|
120
|
+
data2 = TestData.new
|
|
121
|
+
data2.stuff << :b
|
|
122
|
+
data2.inherit_from!(data1)
|
|
123
|
+
assert_equal [:b, :a], data2.stuff.to_a
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def test_inherited_array_can_append_2
|
|
127
|
+
data1 = TestData.new
|
|
128
|
+
data1.stuff = [:a]
|
|
129
|
+
data2 = TestData.new
|
|
130
|
+
data2.stuff << :b
|
|
131
|
+
data2.inherit_from!(data1)
|
|
132
|
+
data3 = TestData.new
|
|
133
|
+
data3.stuff << :c
|
|
134
|
+
data3.inherit_from!(data2)
|
|
135
|
+
assert_equal [:c, :b, :a], data3.stuff.to_a
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def test_inherited_array_can_remove
|
|
139
|
+
data1 = TestData.new
|
|
140
|
+
data1.stuff = [:a]
|
|
141
|
+
data2 = TestData.new
|
|
142
|
+
data2.stuff >> :a
|
|
143
|
+
data2.inherit_from!(data1)
|
|
144
|
+
assert_equal [], data2.stuff.to_a
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def test_inherited_array_combined_augmentations
|
|
148
|
+
data1 = TestData.new
|
|
149
|
+
data1.stuff = [:a]
|
|
150
|
+
data2 = TestData.new
|
|
151
|
+
data2.stuff >> :a
|
|
152
|
+
data2.stuff << :b
|
|
153
|
+
data2.inherit_from!(data1)
|
|
154
|
+
assert_equal [:b], data2.stuff.to_a
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
def test_inherited_array_long_methods
|
|
158
|
+
data1 = TestData.new
|
|
159
|
+
data1.stuff = [:a]
|
|
160
|
+
data2 = TestData.new
|
|
161
|
+
data2.remove_from_stuff(:a)
|
|
162
|
+
data2.add_to_stuff(:b)
|
|
163
|
+
data2.inherit_from!(data1)
|
|
164
|
+
assert_equal [:b], data2.stuff.to_a
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
def test_inherited_array_augmentations_can_be_clobbered
|
|
168
|
+
data1 = TestData.new
|
|
169
|
+
data1.stuff = [:a]
|
|
170
|
+
data2 = TestData.new
|
|
171
|
+
data2.stuff >> :a
|
|
172
|
+
data2.stuff << :b
|
|
173
|
+
data2.stuff = [:c]
|
|
174
|
+
data2.inherit_from!(data1)
|
|
175
|
+
assert_equal [:c], data2.stuff.to_a
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
def test_inherited_array_augmentations_after_clobbering
|
|
179
|
+
data1 = TestData.new
|
|
180
|
+
data1.stuff = [:a]
|
|
181
|
+
data2 = TestData.new
|
|
182
|
+
data2.stuff >> :a
|
|
183
|
+
data2.stuff << :b
|
|
184
|
+
data2.stuff = [:c, :d]
|
|
185
|
+
data2.stuff << :e
|
|
186
|
+
data2.stuff >> :c
|
|
187
|
+
data2.inherit_from!(data1)
|
|
188
|
+
assert_equal [:d, :e], data2.stuff.to_a
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
def test_serialization_warns_with_asset_cache_buster_set
|
|
192
|
+
contents = StringIO.new(<<-CONFIG)
|
|
193
|
+
asset_cache_buster do |path|
|
|
194
|
+
"http://example.com"
|
|
195
|
+
end
|
|
196
|
+
CONFIG
|
|
197
|
+
|
|
198
|
+
Compass.add_configuration(contents, "test_serialization_warns_with_asset_cache_buster_set")
|
|
199
|
+
|
|
200
|
+
assert_kind_of Proc, Compass.configuration.asset_cache_buster_without_default
|
|
201
|
+
assert_equal "http://example.com", Compass.configuration.asset_cache_buster_without_default.call("whatever")
|
|
202
|
+
warning = capture_warning do
|
|
203
|
+
Compass.configuration.serialize
|
|
204
|
+
end
|
|
205
|
+
assert_equal "WARNING: asset_cache_buster is code and cannot be written to a file. You'll need to copy it yourself.\n", warning
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
def test_cache_buster_file_not_passed_when_the_file_does_not_exist
|
|
209
|
+
config = Compass::Configuration::Data.new("test_cache_buster_file_not_passed_when_the_file_does_not_exist")
|
|
210
|
+
the_file = nil
|
|
211
|
+
was_called = nil
|
|
212
|
+
config.asset_cache_buster do |path, file|
|
|
213
|
+
was_called = true
|
|
214
|
+
the_file = file
|
|
215
|
+
"busted=true"
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
Compass.add_configuration(config)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
sass = Sass::Engine.new(<<-SCSS, Compass.configuration.to_sass_engine_options.merge(:syntax => :scss))
|
|
222
|
+
.foo { background: image-url("asdf.gif") }
|
|
223
|
+
SCSS
|
|
224
|
+
sass.render
|
|
225
|
+
assert was_called
|
|
226
|
+
assert_nil the_file
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
def test_cache_buster_file_is_closed
|
|
230
|
+
config = Compass::Configuration::Data.new("test_cache_buster_file_is_closed")
|
|
231
|
+
the_file = nil
|
|
232
|
+
was_called = nil
|
|
233
|
+
FileUtils.touch "images/asdf.gif"
|
|
234
|
+
config.asset_cache_buster do |path, file|
|
|
235
|
+
was_called = true
|
|
236
|
+
the_file = file
|
|
237
|
+
"busted=true"
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
Compass.add_configuration(config)
|
|
241
|
+
|
|
242
|
+
sass = Sass::Engine.new(<<-SCSS, Compass.configuration.to_sass_engine_options.merge(:syntax => :scss))
|
|
243
|
+
.foo { background: image-url("asdf.gif") }
|
|
244
|
+
SCSS
|
|
245
|
+
sass.render
|
|
246
|
+
assert was_called
|
|
247
|
+
assert_kind_of File, the_file
|
|
248
|
+
assert the_file.closed?
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
def test_cache_buster_handles_id_refs_for_images
|
|
252
|
+
config = Compass::Configuration::Data.new("test_cache_buster_file_is_closed")
|
|
253
|
+
the_file = nil
|
|
254
|
+
was_called = nil
|
|
255
|
+
FileUtils.touch "images/asdf.svg"
|
|
256
|
+
config.asset_cache_buster do |path, file|
|
|
257
|
+
was_called = true
|
|
258
|
+
the_file = file
|
|
259
|
+
"busted=true"
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
Compass.add_configuration(config)
|
|
263
|
+
|
|
264
|
+
sass = Sass::Engine.new(<<-SCSS, Compass.configuration.to_sass_engine_options.merge(:syntax => :scss))
|
|
265
|
+
.foo { background: image-url("asdf.svg#image-1") }
|
|
266
|
+
SCSS
|
|
267
|
+
result = sass.render
|
|
268
|
+
assert was_called
|
|
269
|
+
assert_kind_of File, the_file
|
|
270
|
+
assert the_file.closed?
|
|
271
|
+
assert_equal <<CSS, result
|
|
272
|
+
/* line 1 */
|
|
273
|
+
.foo {
|
|
274
|
+
background: url('/images/asdf.svg?busted=true#image-1');
|
|
275
|
+
}
|
|
276
|
+
CSS
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
def test_default_cache_buster_handles_id_refs_for_images
|
|
280
|
+
FileUtils.touch "images/asdf.svg"
|
|
281
|
+
sass = Sass::Engine.new(<<-SCSS, Compass.configuration.to_sass_engine_options.merge(:syntax => :scss))
|
|
282
|
+
.foo { background: image-url("asdf.svg#image-1") }
|
|
283
|
+
SCSS
|
|
284
|
+
result = sass.render
|
|
285
|
+
assert_equal <<CSS, result
|
|
286
|
+
/* line 1 */
|
|
287
|
+
.foo {
|
|
288
|
+
background: url('/images/asdf.svg?#{File.mtime("images/asdf.svg").to_i}#image-1');
|
|
289
|
+
}
|
|
290
|
+
CSS
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
def test_cache_buster_handles_id_refs_for_fonts
|
|
294
|
+
config = Compass::Configuration::Data.new("test_cache_buster_file_is_closed")
|
|
295
|
+
the_file = nil
|
|
296
|
+
was_called = nil
|
|
297
|
+
FileUtils.touch "fonts/asdf.ttf"
|
|
298
|
+
config.asset_cache_buster do |path, file|
|
|
299
|
+
was_called = true
|
|
300
|
+
the_file = file
|
|
301
|
+
"busted=true"
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
Compass.add_configuration(config)
|
|
305
|
+
|
|
306
|
+
sass = Sass::Engine.new(<<-SCSS, Compass.configuration.to_sass_engine_options.merge(:syntax => :scss))
|
|
307
|
+
.foo { background: font-url("asdf.ttf#iefix") }
|
|
308
|
+
SCSS
|
|
309
|
+
result = sass.render
|
|
310
|
+
assert was_called
|
|
311
|
+
assert_kind_of File, the_file
|
|
312
|
+
assert the_file.closed?
|
|
313
|
+
assert_equal <<CSS, result
|
|
314
|
+
/* line 1 */
|
|
315
|
+
.foo {
|
|
316
|
+
background: url('/fonts/asdf.ttf?busted=true#iefix');
|
|
317
|
+
}
|
|
318
|
+
CSS
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
def test_inherited_arrays_augmentations_serialize
|
|
323
|
+
inherited = TestData.new
|
|
324
|
+
inherited.stuff << :a
|
|
325
|
+
d = TestData.new
|
|
326
|
+
d.stuff << :b
|
|
327
|
+
d.stuff >> :c
|
|
328
|
+
assert_equal <<CONFIG, d.serialize_property(:stuff, d.stuff)
|
|
329
|
+
stuff << :b
|
|
330
|
+
stuff >> :c
|
|
331
|
+
CONFIG
|
|
332
|
+
end
|
|
333
|
+
def test_inherited_arrays_clobbering_with_augmentations_serialize
|
|
334
|
+
inherited = TestData.new
|
|
335
|
+
inherited.stuff << :a
|
|
336
|
+
d = TestData.new
|
|
337
|
+
d.stuff << :b
|
|
338
|
+
d.stuff = [:c, :d]
|
|
339
|
+
d.stuff << :e
|
|
340
|
+
assert_equal <<CONFIG, d.serialize_property(:stuff, d.stuff)
|
|
341
|
+
stuff = [:c, :d, :e]
|
|
342
|
+
CONFIG
|
|
343
|
+
end
|
|
344
|
+
def test_additional_import_paths
|
|
345
|
+
contents = StringIO.new(<<-CONFIG)
|
|
346
|
+
http_path = "/"
|
|
347
|
+
project_path = "/home/chris/my_compass_project"
|
|
348
|
+
css_dir = "css"
|
|
349
|
+
additional_import_paths = ["../foo"]
|
|
350
|
+
add_import_path "/path/to/my/framework"
|
|
351
|
+
CONFIG
|
|
352
|
+
|
|
353
|
+
Compass.add_configuration(contents, "test_additional_import_paths")
|
|
354
|
+
|
|
355
|
+
engine_opts = Compass.configuration.to_sass_engine_options
|
|
356
|
+
|
|
357
|
+
load_paths = load_paths_as_strings(engine_opts[:load_paths])
|
|
358
|
+
|
|
359
|
+
plugin_opts = Compass.configuration.to_sass_plugin_options
|
|
360
|
+
|
|
361
|
+
assert load_paths.include?("/home/chris/foo"), "Expected to find /home/chris/foo in #{load_paths.inspect}"
|
|
362
|
+
assert load_paths.include?("/path/to/my/framework"), load_paths.inspect
|
|
363
|
+
|
|
364
|
+
expected_serialization = <<EXPECTED
|
|
365
|
+
require 'compass/import-once/activate'
|
|
366
|
+
# Require any additional compass plugins here.
|
|
367
|
+
project_path = "/home/chris/my_compass_project"
|
|
368
|
+
|
|
369
|
+
http_path = "/"
|
|
370
|
+
css_dir = "css"
|
|
371
|
+
|
|
372
|
+
# You can select your preferred output style here (can be overridden via the command line):
|
|
373
|
+
# output_style = :expanded or :nested or :compact or :compressed
|
|
374
|
+
|
|
375
|
+
# To enable relative paths to assets via compass helper functions. Uncomment:
|
|
376
|
+
# relative_assets = true
|
|
377
|
+
|
|
378
|
+
# To disable debugging comments that display the original location of your selectors. Uncomment:
|
|
379
|
+
# line_comments = false
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
# If you prefer the indented syntax, you might want to regenerate this
|
|
383
|
+
# project again passing --syntax sass, or you can uncomment this:
|
|
384
|
+
# preferred_syntax = :sass
|
|
385
|
+
# and then run:
|
|
386
|
+
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
|
|
387
|
+
additional_import_paths = ["../foo", "/path/to/my/framework"]
|
|
388
|
+
EXPECTED
|
|
389
|
+
assert_equal "/", Compass.configuration.http_path
|
|
390
|
+
assert_correct expected_serialization, Compass.configuration.serialize
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
def test_additional_import_paths_can_be_importers
|
|
394
|
+
contents = StringIO.new(<<-CONFIG)
|
|
395
|
+
http_path = "/"
|
|
396
|
+
project_path = "/home/chris/my_compass_project"
|
|
397
|
+
css_dir = "css"
|
|
398
|
+
preferred_syntax = :scss
|
|
399
|
+
additional_import_paths = ["../foo"]
|
|
400
|
+
add_import_path Sass::Importers::Filesystem.new("/tmp/foo")
|
|
401
|
+
CONFIG
|
|
402
|
+
|
|
403
|
+
Compass.add_configuration(contents, "test_additional_import_paths")
|
|
404
|
+
|
|
405
|
+
assert Compass.configuration.sass_load_paths.find{|p| p.is_a?(Sass::Importers::Filesystem) && p.root == "/tmp/foo"}
|
|
406
|
+
assert Compass.configuration.to_sass_plugin_options[:load_paths].find{|p| p.is_a?(Sass::Importers::Filesystem) && p.root == "/tmp/foo"}
|
|
407
|
+
end
|
|
408
|
+
|
|
409
|
+
def test_config_with_pathname
|
|
410
|
+
contents = StringIO.new(<<-CONFIG)
|
|
411
|
+
http_path = "/"
|
|
412
|
+
project_path = Pathname.new("/home/chris/my_compass_project")
|
|
413
|
+
css_dir = "css"
|
|
414
|
+
additional_import_paths = ["../foo"]
|
|
415
|
+
add_import_path "/path/to/my/framework"
|
|
416
|
+
CONFIG
|
|
417
|
+
|
|
418
|
+
Compass.add_configuration(contents, "test_additional_import_paths")
|
|
419
|
+
|
|
420
|
+
load_paths = load_paths_as_strings(Compass.configuration.to_sass_engine_options[:load_paths])
|
|
421
|
+
|
|
422
|
+
assert load_paths.include?("/home/chris/foo"), "Expected to find /home/chris/foo in #{load_paths.inspect}"
|
|
423
|
+
assert load_paths.include?("/path/to/my/framework"), load_paths.inspect
|
|
424
|
+
|
|
425
|
+
expected_serialization = <<EXPECTED
|
|
426
|
+
require 'compass/import-once/activate'
|
|
427
|
+
# Require any additional compass plugins here.
|
|
428
|
+
project_path = "/home/chris/my_compass_project"
|
|
429
|
+
|
|
430
|
+
http_path = "/"
|
|
431
|
+
css_dir = "css"
|
|
432
|
+
|
|
433
|
+
# You can select your preferred output style here (can be overridden via the command line):
|
|
434
|
+
# output_style = :expanded or :nested or :compact or :compressed
|
|
435
|
+
|
|
436
|
+
# To enable relative paths to assets via compass helper functions. Uncomment:
|
|
437
|
+
# relative_assets = true
|
|
438
|
+
|
|
439
|
+
# To disable debugging comments that display the original location of your selectors. Uncomment:
|
|
440
|
+
# line_comments = false
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
# If you prefer the indented syntax, you might want to regenerate this
|
|
444
|
+
# project again passing --syntax sass, or you can uncomment this:
|
|
445
|
+
# preferred_syntax = :sass
|
|
446
|
+
# and then run:
|
|
447
|
+
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
|
|
448
|
+
additional_import_paths = ["../foo", "/path/to/my/framework"]
|
|
449
|
+
EXPECTED
|
|
450
|
+
assert_equal "/", Compass.configuration.http_path
|
|
451
|
+
assert_correct expected_serialization.split("\n"), Compass.configuration.serialize.split("\n")
|
|
452
|
+
end
|
|
453
|
+
|
|
454
|
+
def test_sass_options
|
|
455
|
+
contents = StringIO.new(<<-CONFIG)
|
|
456
|
+
sass_options = {:foo => 'bar'}
|
|
457
|
+
CONFIG
|
|
458
|
+
|
|
459
|
+
Compass.add_configuration(contents, "test_sass_options")
|
|
460
|
+
|
|
461
|
+
assert_equal 'bar', Compass.configuration.to_sass_engine_options[:foo]
|
|
462
|
+
assert_equal 'bar', Compass.configuration.to_sass_plugin_options[:foo]
|
|
463
|
+
|
|
464
|
+
expected_serialization = <<EXPECTED
|
|
465
|
+
require 'compass/import-once/activate'
|
|
466
|
+
# Require any additional compass plugins here.
|
|
467
|
+
|
|
468
|
+
# Set this to the root of your project when deployed:
|
|
469
|
+
http_path = \"/\"
|
|
470
|
+
|
|
471
|
+
# You can select your preferred output style here (can be overridden via the command line):
|
|
472
|
+
# output_style = :expanded or :nested or :compact or :compressed
|
|
473
|
+
|
|
474
|
+
# To enable relative paths to assets via compass helper functions. Uncomment:
|
|
475
|
+
# relative_assets = true\nsass_options = {:foo=>\"bar\"}
|
|
476
|
+
|
|
477
|
+
# To disable debugging comments that display the original location of your selectors. Uncomment:
|
|
478
|
+
# line_comments = false
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
# If you prefer the indented syntax, you might want to regenerate this
|
|
482
|
+
# project again passing --syntax sass, or you can uncomment this:
|
|
483
|
+
# preferred_syntax = :sass
|
|
484
|
+
# and then run:
|
|
485
|
+
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
|
|
486
|
+
EXPECTED
|
|
487
|
+
|
|
488
|
+
assert_correct(expected_serialization, Compass.configuration.serialize)
|
|
489
|
+
end
|
|
490
|
+
|
|
491
|
+
def test_sprite_load_path_clobbers
|
|
492
|
+
contents = StringIO.new(<<-CONFIG)
|
|
493
|
+
sprite_load_path = ["/Users/chris/Projects/my_compass_project/images/sprites"]
|
|
494
|
+
CONFIG
|
|
495
|
+
|
|
496
|
+
Compass.add_configuration(contents, "test_sass_options")
|
|
497
|
+
|
|
498
|
+
assert_equal ["/Users/chris/Projects/my_compass_project/images/sprites"], Compass.configuration.sprite_load_path.to_a
|
|
499
|
+
|
|
500
|
+
expected_serialization = <<EXPECTED
|
|
501
|
+
require 'compass/import-once/activate'
|
|
502
|
+
# Require any additional compass plugins here.
|
|
503
|
+
|
|
504
|
+
# Set this to the root of your project when deployed:
|
|
505
|
+
http_path = "/"
|
|
506
|
+
|
|
507
|
+
# You can select your preferred output style here (can be overridden via the command line):
|
|
508
|
+
# output_style = :expanded or :nested or :compact or :compressed
|
|
509
|
+
|
|
510
|
+
# To enable relative paths to assets via compass helper functions. Uncomment:
|
|
511
|
+
# relative_assets = true
|
|
512
|
+
|
|
513
|
+
# To disable debugging comments that display the original location of your selectors. Uncomment:
|
|
514
|
+
# line_comments = false
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
# If you prefer the indented syntax, you might want to regenerate this
|
|
518
|
+
# project again passing --syntax sass, or you can uncomment this:
|
|
519
|
+
# preferred_syntax = :sass
|
|
520
|
+
# and then run:
|
|
521
|
+
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
|
|
522
|
+
sprite_load_path = ["/Users/chris/Projects/my_compass_project/images/sprites"]
|
|
523
|
+
EXPECTED
|
|
524
|
+
|
|
525
|
+
assert_correct(expected_serialization, Compass.configuration.serialize)
|
|
526
|
+
end
|
|
527
|
+
|
|
528
|
+
def test_strip_trailing_directory_separators
|
|
529
|
+
contents = StringIO.new(<<-CONFIG)
|
|
530
|
+
css_dir = "css/"
|
|
531
|
+
sass_dir = "sass/"
|
|
532
|
+
images_dir = "images/"
|
|
533
|
+
javascripts_dir = "js/"
|
|
534
|
+
fonts_dir = "fonts/"
|
|
535
|
+
extensions_dir = "extensions/"
|
|
536
|
+
css_path = "css/"
|
|
537
|
+
sass_path = "sass/"
|
|
538
|
+
images_path = "images/"
|
|
539
|
+
javascripts_path = "js/"
|
|
540
|
+
fonts_path = "fonts/"
|
|
541
|
+
extensions_path = "extensions/"
|
|
542
|
+
CONFIG
|
|
543
|
+
|
|
544
|
+
Compass.add_configuration(contents, "test_strip_trailing_directory_separators")
|
|
545
|
+
|
|
546
|
+
assert_equal "css", Compass.configuration.css_dir
|
|
547
|
+
assert_equal "sass", Compass.configuration.sass_dir
|
|
548
|
+
assert_equal "images", Compass.configuration.images_dir
|
|
549
|
+
assert_equal "js", Compass.configuration.javascripts_dir
|
|
550
|
+
assert_equal "fonts", Compass.configuration.fonts_dir
|
|
551
|
+
assert_equal "extensions", Compass.configuration.extensions_dir
|
|
552
|
+
end
|
|
553
|
+
|
|
554
|
+
def test_custom_configuration_properties
|
|
555
|
+
# Add a configuration property to compass.
|
|
556
|
+
Compass::Configuration.add_configuration_property(:foobar, "this is a foobar") do
|
|
557
|
+
if environment == :production
|
|
558
|
+
"foo"
|
|
559
|
+
else
|
|
560
|
+
"bar"
|
|
561
|
+
end
|
|
562
|
+
end
|
|
563
|
+
|
|
564
|
+
contents = StringIO.new(<<-CONFIG)
|
|
565
|
+
foobar = "baz"
|
|
566
|
+
CONFIG
|
|
567
|
+
|
|
568
|
+
Compass.add_configuration(contents, "test_strip_trailing_directory_separators")
|
|
569
|
+
|
|
570
|
+
assert_equal "baz", Compass.configuration.foobar
|
|
571
|
+
expected_serialization = <<EXPECTED
|
|
572
|
+
require 'compass/import-once/activate'
|
|
573
|
+
# Require any additional compass plugins here.
|
|
574
|
+
|
|
575
|
+
# Set this to the root of your project when deployed:
|
|
576
|
+
http_path = "/"
|
|
577
|
+
|
|
578
|
+
# You can select your preferred output style here (can be overridden via the command line):
|
|
579
|
+
# output_style = :expanded or :nested or :compact or :compressed
|
|
580
|
+
|
|
581
|
+
# To enable relative paths to assets via compass helper functions. Uncomment:
|
|
582
|
+
# relative_assets = true
|
|
583
|
+
|
|
584
|
+
# To disable debugging comments that display the original location of your selectors. Uncomment:
|
|
585
|
+
# line_comments = false
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
# If you prefer the indented syntax, you might want to regenerate this
|
|
589
|
+
# project again passing --syntax sass, or you can uncomment this:
|
|
590
|
+
# preferred_syntax = :sass
|
|
591
|
+
# and then run:
|
|
592
|
+
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
|
|
593
|
+
|
|
594
|
+
# this is a foobar
|
|
595
|
+
foobar = "baz"
|
|
596
|
+
EXPECTED
|
|
597
|
+
assert_correct(expected_serialization, Compass.configuration.serialize)
|
|
598
|
+
Compass.reset_configuration!
|
|
599
|
+
Compass.configuration.environment = :production
|
|
600
|
+
assert_equal "foo", Compass.configuration.foobar
|
|
601
|
+
Compass.configuration.environment = :development
|
|
602
|
+
assert_equal "bar", Compass.configuration.foobar
|
|
603
|
+
ensure
|
|
604
|
+
Compass::Configuration.remove_configuration_property :foobar
|
|
605
|
+
end
|
|
606
|
+
|
|
607
|
+
def load_paths_as_strings(load_paths)
|
|
608
|
+
load_paths.map do |path|
|
|
609
|
+
case path
|
|
610
|
+
when Sass::Importers::Filesystem
|
|
611
|
+
path.root
|
|
612
|
+
when String, Pathname
|
|
613
|
+
path.to_s
|
|
614
|
+
end
|
|
615
|
+
end.compact
|
|
616
|
+
end
|
|
617
|
+
|
|
618
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
require 'compass'
|
|
3
|
+
require 'compass/exec'
|
|
4
|
+
require 'stringio'
|
|
5
|
+
|
|
6
|
+
class RegressionsTest < Test::Unit::TestCase
|
|
7
|
+
include SpriteHelper
|
|
8
|
+
include Compass::CommandLineHelper
|
|
9
|
+
|
|
10
|
+
def setup
|
|
11
|
+
create_sprite_temp
|
|
12
|
+
Compass.reset_configuration!
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def teardown
|
|
16
|
+
clean_up_sprites
|
|
17
|
+
Compass.reset_configuration!
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def test_issue911_sprites_with_globbing_and_line_comments
|
|
21
|
+
within_tmp_directory do
|
|
22
|
+
compass "create --bare issue911"
|
|
23
|
+
FileUtils.mkdir_p "issue911/images/sprites/a"
|
|
24
|
+
FileUtils.mkdir_p "issue911/images/sprites/b"
|
|
25
|
+
FileUtils.cp File.join(@images_tmp_path, 'nested/squares/ten-by-ten.png'), "issue911/images/sprites/a/foo.png"
|
|
26
|
+
FileUtils.cp File.join(@images_tmp_path, 'nested/squares/ten-by-ten.png'), "issue911/images/sprites/a/bar.png"
|
|
27
|
+
Dir.chdir "issue911" do
|
|
28
|
+
result = compile_for_project(<<-SCSS)
|
|
29
|
+
@import "sprites/**/*.png";
|
|
30
|
+
SCSS
|
|
31
|
+
Sass::Engine.new(result, :syntax => :scss).render # raises an error if we generated invalid css
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|