File: sass_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 (29 lines) | stat: -rw-r--r-- 813 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
# frozen_string_literal: true

require 'test_helper'
require 'shellwords'
require 'fileutils'
require 'bootstrap-sass'

class SassTest < Minitest::Test
  DUMMY_PATH = 'test/dummy_sass_only'

  def test_font_helper
    assert_match %r{url\(['"]?.*eot['"]?\)}, @css
  end

  def setup
    FileUtils.rm_rf(File.join(DUMMY_PATH, '.sass-cache'), secure: true)
    css_path = File.join GEM_PATH, 'tmp/bootstrap-sass-only.css'
    success  = Dir.chdir DUMMY_PATH do
      silence_stdout_if !ENV['VERBOSE'] do
        Bundler.with_original_env do
          system('bundle') && system('bundle', 'exec', 'ruby', 'compile.rb',
                                     Bootstrap.stylesheets_path, css_path)
        end
      end
    end
    assert success, 'Sass-only compilation failed'
    @css = File.read(css_path)
  end
end