File: compilation_test.rb

package info (click to toggle)
node-bootstrap-sass 3.4.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,492 kB
  • sloc: javascript: 3,526; ruby: 1,249; sh: 5; makefile: 3
file content (30 lines) | stat: -rw-r--r-- 707 bytes parent folder | download | duplicates (3)
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