1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Remove haml_warn - dead code

This commit is contained in:
Norman Clarke 2012-05-22 16:54:02 -03:00
parent 3751e81fc2
commit 2311bb2c2b
2 changed files with 0 additions and 33 deletions

View file

@ -153,25 +153,6 @@ module Haml
$stderr = the_real_stderr
end
# Silences all Haml warnings within a block.
#
# @yield A block in which no Haml warnings will be printed
def silence_haml_warnings
old_silence_warnings = Thread.current[:silence_haml_warnings]
Thread.current[:silence_haml_warnings] = true
yield
ensure
Thread.current[:silence_haml_warnings] = old_silence_warnings
end
# The same as `Kernel#warn`, but is silenced by \{#silence\_haml\_warnings}.
#
# @param msg [String]
def haml_warn(msg)
return if Thread.current[:silence_haml_warnings]
warn(msg)
end
## Cross Rails Version Compatibility
# Returns the root of the Rails application,

View file

@ -67,20 +67,6 @@ class UtilTest < MiniTest::Unit::TestCase
$stderr = old_stderr
end
def test_haml_warn
assert_warning("Foo!") {haml_warn "Foo!"}
end
def test_silence_haml_warnings
old_stderr, $stderr = $stderr, StringIO.new
silence_haml_warnings {warn "Out"}
assert_equal("Out\n", $stderr.string)
silence_haml_warnings {haml_warn "In"}
assert_equal("Out\n", $stderr.string)
ensure
$stderr = old_stderr
end
def test_has
assert(has?(:instance_method, String, :chomp!))
assert(has?(:private_instance_method, Haml::Engine, :set_locals))