sprite importer will now error if it does not find the associated glob

This commit is contained in:
Scott Davis 2012-01-30 22:12:01 -05:00
parent 11cf736066
commit 7198a69909
4 changed files with 5 additions and 2 deletions

View File

@ -7,4 +7,5 @@ module Compass
class MissingDependency < Error class MissingDependency < Error
end end
class SpriteException < Error; end
end end

View File

@ -2,7 +2,6 @@ require 'digest/md5'
require 'compass/sprite_importer' require 'compass/sprite_importer'
module Compass module Compass
class SpriteException < Exception; end
module SassExtensions module SassExtensions
module Sprites module Sprites
end end

View File

@ -79,6 +79,9 @@ module Compass
next if files.empty? next if files.empty?
return files return files
end end
path = Compass.configuration.sprite_load_path.to_a.join(', ')
raise Compass::SpriteException, %Q{No files were found in the load path matching "#{uri}". Your current load paths are: #{path}}
end end
# Returns an Array of image names without the file extension # Returns an Array of image names without the file extension

View File

@ -47,7 +47,7 @@ class SpriteCommandTest < Test::Unit::TestCase
end end
it "should create sprite file" do it "should create sprite file" do
assert_equal 0, run_compass_with_options(['sprite', "-f", 'stylesheet.scss', "'#{@images_tmp_path}/*.png'"]).to_i assert_equal 0, run_compass_with_options(['sprite', "-f", 'stylesheet.scss', "squares/*.png"]).to_i
assert File.exists?(File.join(test_dir, 'stylesheet.scss')) assert File.exists?(File.join(test_dir, 'stylesheet.scss'))
end end