Sha256: 06e632c8d1dff985d600894f57c880665b0c183f5dbdd558918f30676ec7287f

Contents?: true

Size: 1.09 KB

Versions: 6

Compression:

Stored size: 1.09 KB

Contents

lib_dir = File.dirname(__FILE__) + '/../lib'
require File.dirname(__FILE__) + '/linked_rails'

require 'test/unit'
require 'fileutils'
$:.unshift lib_dir unless $:.include?(lib_dir)
require 'haml'
require 'sass'

Sass::RAILS_LOADED = true unless defined?(Sass::RAILS_LOADED)

module Sass::Script::Functions
  def option(name)
    Sass::Script::String.new(@options[name.value.to_sym].to_s)
  end
end

class Test::Unit::TestCase
  def munge_filename(opts)
    return if opts[:filename]
    opts[:filename] = test_filename(caller[1])
  end

  def test_filename(entry = caller.first)
    test_name = Haml::Util.caller_info(entry)[2]
    test_name.sub!(/^(block|rescue) in /, '')
    "#{test_name}_inline.sass"
  end

  def clean_up_sassc
    path = File.dirname(__FILE__) + "/../.sass-cache"
    FileUtils.rm_r(path) if File.exist?(path)
  end

  def assert_warning(message)
    the_real_stderr, $stderr = $stderr, StringIO.new
    yield
    assert_equal message.strip, $stderr.string.strip
  ensure
    $stderr = the_real_stderr
  end

  def silence_warnings(&block)
    Haml::Util.silence_warnings(&block)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
haml-edge-2.3.99 test/test_helper.rb
haml-edge-2.3.98 test/test_helper.rb
haml-edge-2.3.97 test/test_helper.rb
haml-edge-2.3.96 test/test_helper.rb
haml-edge-2.3.95 test/test_helper.rb
haml-edge-2.3.94 test/test_helper.rb