diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-12-28 20:49:41 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-12-31 13:58:52 -0300 |
commit | 5294ad82c6096edba06f4111325d6b0e6845d9f0 (patch) | |
tree | cec386a00a691b26906ce4e335f49da26ecf6938 /activesupport | |
parent | 6c0013f7cda487de101d47376b9f1355ff1ef095 (diff) | |
download | rails-5294ad82c6096edba06f4111325d6b0e6845d9f0.tar.gz rails-5294ad82c6096edba06f4111325d6b0e6845d9f0.tar.bz2 rails-5294ad82c6096edba06f4111325d6b0e6845d9f0.zip |
Alias refute methods to assert_not and perfer assert_not on tests
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/test_case.rb | 11 | ||||
-rw-r--r-- | activesupport/test/core_ext/thread_test.rb | 4 | ||||
-rw-r--r-- | activesupport/test/string_inquirer_test.rb | 2 |
3 files changed, 13 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb index 4290d5b3ed..8b392c36d0 100644 --- a/activesupport/lib/active_support/test_case.rb +++ b/activesupport/lib/active_support/test_case.rb @@ -41,9 +41,18 @@ module ActiveSupport # test/unit backwards compatibility methods alias :assert_raise :assert_raises - alias :assert_not_nil :refute_nil + alias :assert_not_empty :refute_empty alias :assert_not_equal :refute_equal + alias :assert_not_in_delta :refute_in_delta + alias :assert_not_in_epsilon :refute_in_epsilon + alias :assert_not_includes :refute_includes + alias :assert_not_instance_of :refute_instance_of + alias :assert_not_kind_of :refute_kind_of alias :assert_no_match :refute_match + alias :assert_not_nil :refute_nil + alias :assert_not_operator :refute_operator + alias :assert_not_predicate :refute_predicate + alias :assert_not_respond_to :refute_respond_to alias :assert_not_same :refute_same # Fails if the block raises an exception. diff --git a/activesupport/test/core_ext/thread_test.rb b/activesupport/test/core_ext/thread_test.rb index b58f59a8d4..230c1203ad 100644 --- a/activesupport/test/core_ext/thread_test.rb +++ b/activesupport/test/core_ext/thread_test.rb @@ -39,14 +39,14 @@ class ThreadExt < ActiveSupport::TestCase end def test_thread_variable? - refute Thread.new { Thread.current.thread_variable?("foo") }.join.value + assert_not Thread.new { Thread.current.thread_variable?("foo") }.join.value t = Thread.new { Thread.current.thread_variable_set("foo", "bar") }.join assert t.thread_variable?("foo") assert t.thread_variable?(:foo) - refute t.thread_variable?(:bar) + assert_not t.thread_variable?(:bar) end def test_thread_variable_strings_and_symbols_are_the_same_key diff --git a/activesupport/test/string_inquirer_test.rb b/activesupport/test/string_inquirer_test.rb index 94d5fe197d..a2ed577eb0 100644 --- a/activesupport/test/string_inquirer_test.rb +++ b/activesupport/test/string_inquirer_test.rb @@ -10,7 +10,7 @@ class StringInquirerTest < ActiveSupport::TestCase end def test_miss - refute @string_inquirer.development? + assert_not @string_inquirer.development? end def test_missing_question_mark |