Methods
- M
- S
- T
-
- teardown,
- test_assert_deprecated_matches_any_warning,
- test_assert_deprecated_returns_result_of_block,
- test_assert_deprecated_warn_work_with_default_behavior,
- test_assert_deprecation_without_match,
- test_assert_not_deprecated_returns_result_of_block,
- test_assertion_failed_error_doesnt_spout_deprecation_warnings,
- test_deprecate_class_method,
- test_deprecated_constant_proxy,
- test_deprecated_instance_variable_proxy,
- test_deprecated_instance_variable_proxy_shouldnt_warn_on_inspect,
- test_deprecation_with_alternate_method,
- test_deprecation_with_explicit_message,
- test_deprecation_without_explanation,
- test_inline_deprecation_warning,
- test_nil_behavior_is_ignored,
- test_several_behaviors,
- test_silence,
- test_undeprecated
Instance Public methods
message()
Link
setup()
Link
teardown()
Link
test_assert_deprecated_matches_any_warning()
Link
# File activesupport/test/deprecation_test.rb, line 118 def test_assert_deprecated_matches_any_warning assert_deprecated 'abc' do ActiveSupport::Deprecation.warn 'abc' ActiveSupport::Deprecation.warn 'def' end rescue Test::Unit::AssertionFailedError flunk 'assert_deprecated should match any warning in block, not just the last one' end
test_assert_deprecated_returns_result_of_block()
Link
test_assert_deprecated_warn_work_with_default_behavior()
Link
test_assert_deprecation_without_match()
Link
test_assert_not_deprecated_returns_result_of_block()
Link
test_assertion_failed_error_doesnt_spout_deprecation_warnings()
Link
# File activesupport/test/deprecation_test.rb, line 171 def test_assertion_failed_error_doesnt_spout_deprecation_warnings error_class = Class.new(StandardError) do def message ActiveSupport::Deprecation.warn 'warning in error message' super end end raise error_class.new('hmm') rescue => e error = Test::Unit::Error.new('testing ur doodz', e) assert_not_deprecated { error.message } assert_nil @last_message end
test_deprecate_class_method()
Link
# File activesupport/test/deprecation_test.rb, line 64 def test_deprecate_class_method assert_deprecated(/none is deprecated/) do assert_equal 1, @dtc.none end assert_deprecated(/one is deprecated/) do assert_equal 1, @dtc.one(1) end assert_deprecated(/multi is deprecated/) do assert_equal [1,2,3], @dtc.multi(1,2,3) end end
test_deprecated_constant_proxy()
Link
test_deprecated_instance_variable_proxy()
Link
# File activesupport/test/deprecation_test.rb, line 96 def test_deprecated_instance_variable_proxy assert_not_deprecated { @dtc.request.size } assert_deprecated('@request.size') { assert_equal @dtc.request.size, @dtc.old_request.size } assert_deprecated('@request.to_s') { assert_equal @dtc.request.to_s, @dtc.old_request.to_s } end
test_deprecated_instance_variable_proxy_shouldnt_warn_on_inspect()
Link
test_deprecation_with_alternate_method()
Link
test_deprecation_with_explicit_message()
Link
test_deprecation_without_explanation()
Link
test_inline_deprecation_warning()
Link
test_nil_behavior_is_ignored()
Link
test_several_behaviors()
Link
# File activesupport/test/deprecation_test.rb, line 83 def test_several_behaviors @a, @b = nil, nil ActiveSupport::Deprecation.behavior = [ Proc.new { |msg, callstack| @a = msg }, Proc.new { |msg, callstack| @b = msg } ] @dtc.partially assert_match(/foo=nil/, @a) assert_match(/foo=nil/, @b) end
test_silence()
Link
# File activesupport/test/deprecation_test.rb, line 146 def test_silence ActiveSupport::Deprecation.silence do assert_not_deprecated { @dtc.partially } end ActiveSupport::Deprecation.silenced = true assert_not_deprecated { @dtc.partially } ActiveSupport::Deprecation.silenced = false end