diff --git a/lib/compass/compiler.rb b/lib/compass/compiler.rb index 345adb50..3e028f9c 100644 --- a/lib/compass/compiler.rb +++ b/lib/compass/compiler.rb @@ -36,7 +36,7 @@ module Compass def stylesheet_name(sass_file) if sass_file.index(from) == 0 - sass_file[(from.length + 1)..-6] + sass_file[(from.length + 1)..-6].sub(/\.css$/,'') else raise Compass::Error, "You must compile individual stylesheets from the project directory." end diff --git a/test/units/compiler_test.rb b/test/units/compiler_test.rb new file mode 100644 index 00000000..8e2fe604 --- /dev/null +++ b/test/units/compiler_test.rb @@ -0,0 +1,11 @@ +require 'test_helper' +require 'fileutils' + +class CompilerTest < Test::Unit::TestCase + + it "should strip css from file name and reappend" do + compiler = Compass::Compiler.new(Dir.pwd, 'foo', 'bar', {}) + assert_equal 'screen', compiler.stylesheet_name(File.join(Dir.pwd, 'foo', 'screen.css.scss')) + end + +end \ No newline at end of file