diff --git a/lib/sass/rails/importer.rb b/lib/sass/rails/importer.rb index 7a04c28..9d20991 100644 --- a/lib/sass/rails/importer.rb +++ b/lib/sass/rails/importer.rb @@ -35,6 +35,7 @@ def glob_imports(base, glob, options) end return nil if contents == "" Sass::Engine.new(contents, options.merge( + :filename => base, :importer => self, :syntax => :scss )) diff --git a/test/sass_rails_test.rb b/test/sass_rails_test.rb index bdc1b97..a6a4385 100644 --- a/test/sass_rails_test.rb +++ b/test/sass_rails_test.rb @@ -149,6 +149,23 @@ class SassRailsTest < Sass::Rails::TestCase end end + test 'globbed imports work when globbed file is changed' do + project = 'scss_project' + filename = 'application.scss' + + within_rails_app(project) do |tmpdir| + asset_output(filename) + + new_file = File.join(tmpdir, 'app', 'assets', 'stylesheets', 'globbed', 'globbed.scss') + File.open(new_file, 'w') do |file| + file.puts '.changed-file-test { color: #000; }' + end + + css_output = asset_output(filename) + assert_match /changed-file-test/, css_output + end + end + test 'sass asset paths work' do css_output = sprockets_render('scss_project', 'application.scss') assert_match %r{asset-path:\s*"/assets/rails.png"}, css_output, 'asset-path:\s*"/assets/rails.png"'