Sha256: 711c03a482124bb863db77c4cba29cf8453ad527d7a12b56b7279d0709964ed6

Contents?: true

Size: 880 Bytes

Versions: 9

Compression:

Stored size: 880 Bytes

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)

class Test::Unit::TestCase
  def munge_filename(opts)
    return if opts[:filename]
    test_name = caller[1].gsub(/^.*`(?:\w+ )*(\w+)'.*$/, '\1')
    opts[:filename] = "#{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

9 entries across 9 versions & 3 rubygems

Version Path
middleman-0.12.2 lib/middleman/vendor/gems/gems/haml-2.2.16/test/test_helper.rb
simple-templater-0.0.1.4 gems/gems/haml-2.2.16/test/test_helper.rb
haml-2.2.16 test/test_helper.rb
middleman-0.12.1 lib/middleman/vendor/gems/gems/haml-2.2.15/test/test_helper.rb
middleman-0.12.0.pre3 lib/middleman/vendor/gems/gems/haml-2.2.15/test/test_helper.rb
middleman-0.12.0.pre2 lib/middleman/vendor/gems/gems/haml-2.2.15/test/test_helper.rb
haml-2.2.15 test/test_helper.rb
middleman-0.12.0.pre lib/middleman/vendor/gems/gems/haml-2.2.14/test/test_helper.rb
haml-2.2.14 test/test_helper.rb