strip .css from file names w/ test
This commit is contained in:
parent
7b263fab5c
commit
7d87a2eee8
@ -36,7 +36,7 @@ module Compass
|
|||||||
|
|
||||||
def stylesheet_name(sass_file)
|
def stylesheet_name(sass_file)
|
||||||
if sass_file.index(from) == 0
|
if sass_file.index(from) == 0
|
||||||
sass_file[(from.length + 1)..-6]
|
sass_file[(from.length + 1)..-6].sub(/\.css$/,'')
|
||||||
else
|
else
|
||||||
raise Compass::Error, "You must compile individual stylesheets from the project directory."
|
raise Compass::Error, "You must compile individual stylesheets from the project directory."
|
||||||
end
|
end
|
||||||
|
11
test/units/compiler_test.rb
Normal file
11
test/units/compiler_test.rb
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user