Sha256: 29b99c996216b19981130f0b9946adf59f4425b7d44ab41b97c47ceba5fe93ec

Contents?: true

Size: 818 Bytes

Versions: 3

Compression:

Stored size: 818 Bytes

Contents

require 'test/unit'
require 'sass'
require 'sass-import_once'

class SassImportOnceTest < Test::Unit::TestCase

  def test_will_import_file_once
    css = render_file("test.scss")
    assert_equal 1, css.scan(/#i\.was\.imported/).count
  end

private
  def render_file(filename)
    fixtures_dir = File.expand_path("fixtures", File.dirname(__FILE__))
    full_filename = File.expand_path(filename, fixtures_dir)
    syntax = File.extname(full_filename)[1..-1].to_sym
    engine = Sass::Engine.new(File.read(full_filename),
                              :syntax => syntax,
                              :filename => full_filename,
                              :cache => false,
                              :read_cache => false,
                              :load_paths => [fixtures_dir])
    engine.render
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sass-import_once-0.1.3 test/sass_import_once_test.rb
sass-import_once-0.1.2 test/sass_import_once_test.rb
sass-import_once-0.1.0 test/sass_import_once_test.rb