Welcome to mirror list, hosted at ThFree Co, Russian Federation.

compilation_test.rb « test - github.com/twbs/bootstrap-sass.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7e8be285d7a0555ae7932ebc67567876afaac63f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require 'test_helper'
require 'fileutils'
require 'sassc'

class CompilationTest < Minitest::Test
  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