diff options
author | Gleb Mazovetskiy <glex.spb@gmail.com> | 2018-12-14 14:30:59 +0300 |
---|---|---|
committer | Gleb Mazovetskiy <glex.spb@gmail.com> | 2018-12-14 15:16:04 +0300 |
commit | 3c126b3d9616bc07b6d976f8aee7ad662bd8013a (patch) | |
tree | f4fed127d124ff0c772344a06868520a44f78954 /test | |
parent | dcdef9bfd81a9821d775417dbdab4c5df3553ba2 (diff) |
Revert relative imports change
Diffstat (limited to 'test')
-rw-r--r-- | test/compilation_test.rb | 34 | ||||
-rw-r--r-- | test/dummy_sass_only/Gemfile | 2 | ||||
-rw-r--r-- | test/dummy_sass_only/compile.rb | 2 | ||||
-rw-r--r-- | test/sass_test.rb | 1 |
4 files changed, 26 insertions, 13 deletions
diff --git a/test/compilation_test.rb b/test/compilation_test.rb index c44a97ac..7e8be285 100644 --- a/test/compilation_test.rb +++ b/test/compilation_test.rb @@ -3,16 +3,28 @@ require 'fileutils' require 'sassc' class CompilationTest < Minitest::Test - def test_compilation - path = 'assets/stylesheets' - %w(_bootstrap bootstrap/_theme).each do |file| - FileUtils.rm_rf('.sass-cache', secure: true) - engine = SassC::Engine.new(File.read("#{path}/#{file}.scss"), syntax: :scss, load_paths: [path]) - FileUtils.mkdir_p("tmp/#{File.dirname(file)}") - File.open("tmp/#{file}.css", 'w') { |f| - f.write engine.render - } - assert true # nothing was raised - end + def test_compilation_bootstrap + compile 'bootstrap' + assert true # nothing was raised + end + + def test_compilation_bootstrap_theme + compile 'bootstrap/theme' + assert true # nothing was raised + end + + private + + def compile(file) + path = File.expand_path('../assets/stylesheets', __dir__) + FileUtils.rm_rf('.sass-cache', secure: true) + engine = SassC::Engine.new( + %Q{@import "#{path}/#{file}"}, + syntax: :scss, load_paths: ['.'] + ) + FileUtils.mkdir_p("tmp/#{File.dirname(file)}") + File.open("tmp/#{file}.css", 'w') { |f| + f.write engine.render + } end end diff --git a/test/dummy_sass_only/Gemfile b/test/dummy_sass_only/Gemfile index 784b2761..a74bb8f9 100644 --- a/test/dummy_sass_only/Gemfile +++ b/test/dummy_sass_only/Gemfile @@ -1,4 +1,4 @@ source 'https://rubygems.org' -gem 'sassc', '>= 1.12.1' +gem 'sassc', '>= 2.0.0' gem 'bootstrap-sass', path: '../..' diff --git a/test/dummy_sass_only/compile.rb b/test/dummy_sass_only/compile.rb index 6253af11..50bf3455 100644 --- a/test/dummy_sass_only/compile.rb +++ b/test/dummy_sass_only/compile.rb @@ -9,7 +9,7 @@ out_path = ARGV[1] output = SassC::Engine.new( File.read(File.expand_path('./import_all.scss', __dir__)), - syntax: :scss, load_paths: [load_path] + syntax: :scss, load_paths: ['.', load_path] ).render if out_path diff --git a/test/sass_test.rb b/test/sass_test.rb index 0cb43533..155603b0 100644 --- a/test/sass_test.rb +++ b/test/sass_test.rb @@ -3,6 +3,7 @@ require 'test_helper' require 'shellwords' require 'fileutils' +require 'bootstrap-sass' class SassTest < Minitest::Test DUMMY_PATH = 'test/dummy_sass_only' |