spec/custom_importer_spec.rb in sprockets-sass-1.3.1 vs spec/custom_importer_spec.rb in sprockets-sass-2.0.0.beta1

- old
+ new

@@ -10,23 +10,21 @@ # Initialize the environment. @root = create_construct @assets = @root.directory 'assets' @env = Sprockets::Environment.new @root.to_s @env.append_path @assets.to_s - @env.register_postprocessor 'text/css', :fail_postprocessor do |_, data| - data.gsub /@import/, 'fail engine' - end + @env.register_postprocessor 'text/css', FailPostProcessor end after :each do @root.destroy! + #Sprockets::Sass.options[:importer] = nil end it 'allow specifying custom sass importer' do - @assets.file 'main.css.scss', %(@import "dep";) + @assets.file 'main.css.scss', %(@import "dep") @assets.file 'dep.css.scss', "$color: blue;\nbody { color: $color; }" - @env['main.css'] - + asset = @env['main.css'] expect(@custom_importer.has_been_used).to be_truthy end end