diff --git a/lib/compass/sprite_importer.rb b/lib/compass/sprite_importer.rb index e2a775d2..589f36e5 100644 --- a/lib/compass/sprite_importer.rb +++ b/lib/compass/sprite_importer.rb @@ -19,7 +19,7 @@ module Compass end def find_relative(uri, base, options) - find(File.join(base, uri), options) + nil end def to_s @@ -85,13 +85,13 @@ module Compass end # Returns the sass_options for this sprite - def self.sass_options(name, importer, options) - options.merge!(:filename => name, :syntax => :scss, :importer => importer) + def self.sass_options(uri, importer, options) + options.merge!(:filename => uri, :syntax => :scss, :importer => importer) end # Returns a Sass::Engine for this sprite object def self.sass_engine(uri, name, importer, options) - Sass::Engine.new(content_for_images(uri, name, options[:skip_overrides]), sass_options(name, importer, options)) + Sass::Engine.new(content_for_images(uri, name, options[:skip_overrides]), sass_options(uri, importer, options)) end # Generates the Sass for this sprite file diff --git a/test/units/sprites/importer_test.rb b/test/units/sprites/importer_test.rb index a726a413..e4030017 100644 --- a/test/units/sprites/importer_test.rb +++ b/test/units/sprites/importer_test.rb @@ -68,6 +68,12 @@ class ImporterTest < Test::Unit::TestCase assert_equal 'bar', opts[:foo] end + test "verify that the sass_engine passes the correct filename" do + importer = Compass::SpriteImporter.new + engine = Compass::SpriteImporter.sass_engine(URI, 'foo', importer, options) + assert_equal engine.options[:filename], URI + end + test "should fail given bad sprite extensions" do @images_src_path = File.join(File.dirname(__FILE__), '..', '..', 'fixtures', 'sprites', 'public', 'images') file = StringIO.new("images_path = #{@images_src_path.inspect}\n")