moved test files to a more sain structure

This commit is contained in:
Scott Davis 2011-05-10 18:01:12 -04:00
parent 27d3aca067
commit 8f675f936b
10 changed files with 19 additions and 2 deletions

View File

@ -10,8 +10,12 @@ class SpritesBaseTest < Test::Unit::TestCase
config.images_path = @images_tmp_path config.images_path = @images_tmp_path
Compass.add_configuration(config) Compass.add_configuration(config)
Compass.configure_sass_plugin! Compass.configure_sass_plugin!
options = Compass.sass_engine_options.extend Compass::SassExtensions::Functions::Sprites::VariableReader @options = Compass.sass_engine_options.extend Compass::SassExtensions::Functions::Sprites::VariableReader
@map = Compass::SpriteMap.new("selectors/*.png", options) setup_map
end
def setup_map
@map = Compass::SpriteMap.new("selectors/*.png", @options)
@base = Compass::SassExtensions::Sprites::Base.new(@map.sprite_names.map{|n| "selectors/#{n}.png"}, @map, @map.sass_engine, @map.options) @base = Compass::SassExtensions::Sprites::Base.new(@map.sprite_names.map{|n| "selectors/#{n}.png"}, @map, @map.sass_engine, @map.options)
end end
@ -70,4 +74,17 @@ class SpritesBaseTest < Test::Unit::TestCase
assert !@base.outdated? assert !@base.outdated?
end end
it "should remove old sprite when generating new" do
@base.generate
file = @base.filename
assert File.exists?(file), "Original file does not exist"
file_to_remove = File.join(@images_tmp_path, 'selectors', 'ten-by-ten.png')
FileUtils.rm file_to_remove
assert !File.exists?(file_to_remove), "Failed to remove sprite file"
@options["remove_old_sprites"] = true
setup_map
@base.generate
assert !File.exists?(file), "Sprite file did not get removed"
end
end end