Skip to content

Commit a7740dc

Browse files
committed
tests all pass!
1 parent e18fdc4 commit a7740dc

File tree

5 files changed

+8
-3
lines changed

5 files changed

+8
-3
lines changed

cli/test/fixtures/stylesheets/compass/config.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Require any additional compass plugins here.
22
require 'true'
33
require 'compass/import-once/activate'
4+
require 'compass/sprites'
45
project_type = :stand_alone
56
css_dir = "tmp"
67
sass_dir = "sass"

sprites/lib/compass/sprites.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
require 'compass/sprites/version'
33
config = Compass::Configuration::Data.new("compass-sprites")
44
config.add_import_path(Compass::Sprites::Importer.new)
5-
puts config.inspect
65
Compass.add_configuration(config)

sprites/lib/compass/sprites/importer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Compass
77
module Sprites
88
class Importer < Sass::Importers::Base
99
VAILD_FILE_NAME = /\A#{Sass::SCSS::RX::IDENT}\Z/
10-
SPRITE_IMPORTER_REGEX = %r{((.+/)?([^\*.]+))/(.+?)}
10+
SPRITE_IMPORTER_REGEX = %r{((.+\/)?([^\*.]+))\/(.+?)}
1111

1212
TEMPLATE_FOLDER = File.join(File.expand_path('../', __FILE__), 'importer')
1313
CONTENT_TEMPLATE_FILE = File.join(TEMPLATE_FOLDER, 'content.erb')
@@ -21,7 +21,7 @@ def self.find_all_sprite_map_files(path)
2121
end
2222

2323
def find(uri, options)
24-
if uri =~ SPRITE_IMPORTER_REGEX
24+
if uri =~ self.class.sprite_importer_regex_with_ext
2525
return self.class.sass_engine(uri, self.class.sprite_name(uri), self, options)
2626
end
2727
nil

sprites/test/integrations/sprites_test.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ def setup
1818
::FileUtils.cp_r @images_src_path, @images_tmp_path
1919
::FileUtils.mkdir_p @generated_images_tmp_path
2020
file = StringIO.new(<<-CONFIG)
21+
require 'compass/sprites'
2122
project_path = "#{@images_project_path}"
2223
images_dir = "#{@images_tmp_dir}"
24+
add_import_path(Compass::Sprites::Importer.new)
2325
CONFIG
2426
Compass.add_configuration(file, "sprite_config")
2527
Compass.configure_sass_plugin!
@@ -95,6 +97,7 @@ def clean(string)
9597
images_path = #{@images_tmp_path.inspect}
9698
generated_images_path = #{@generated_images_tmp_path.inspect}
9799
http_generated_images_path = "/images/generated"
100+
add_import_path(Compass::Sprites::Importer.new)
98101
CONFIG
99102
Compass.add_configuration(file, "sprite_config")
100103
Compass.configure_sass_plugin!
@@ -980,6 +983,7 @@ def clean(string)
980983
file = StringIO.new(<<-CONFIG)
981984
images_path = #{@images_tmp_path.inspect}
982985
generated_images_path = #{@generated_images_tmp_path.inspect}
986+
add_import_path(Compass::Sprites::Importer.new)
983987
CONFIG
984988
Compass.add_configuration(file, "sprite_config")
985989
Compass.configure_sass_plugin!

test/common/helpers/test_case.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def absolutize(path)
1414
# compile a Sass string in the context of a project in the current working directory.
1515
def compile_for_project(contents, options = {})
1616
Compass.add_project_configuration
17+
Compass.configuration.add_import_path Compass::Sprites::Importer.new
1718
options[:syntax] ||= :scss
1819
Sass::Engine.new(contents, Compass.configuration.to_sass_engine_options.merge(options)).render
1920
end

0 commit comments

Comments
 (0)