From 5294ad82c6096edba06f4111325d6b0e6845d9f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?=
 <rafaelmfranca@gmail.com>
Date: Fri, 28 Dec 2012 20:49:41 -0300
Subject: Alias refute methods to assert_not and perfer assert_not on tests

---
 actionpack/lib/action_dispatch/testing/assertions/dom.rb |  2 +-
 actionpack/test/controller/live_stream_test.rb           |  2 +-
 actionpack/test/dispatch/live_response_test.rb           |  2 +-
 actionpack/test/dispatch/request/session_test.rb         |  2 +-
 actionpack/test/dispatch/session/abstract_store_test.rb  |  2 +-
 actionpack/test/dispatch/ssl_test.rb                     |  2 +-
 actionpack/test/journey/gtg/transition_table_test.rb     |  4 ++--
 actionpack/test/journey/nfa/simulator_test.rb            | 10 +++++-----
 actionpack/test/journey/nodes/symbol_test.rb             |  2 +-
 actionpack/test/journey/path/pattern_test.rb             | 10 +++++-----
 actionpack/test/journey/route_test.rb                    |  2 +-
 actionpack/test/journey/router_test.rb                   |  2 +-
 actionpack/test/journey/routes_test.rb                   |  4 ++--
 13 files changed, 23 insertions(+), 23 deletions(-)

(limited to 'actionpack')

diff --git a/actionpack/lib/action_dispatch/testing/assertions/dom.rb b/actionpack/lib/action_dispatch/testing/assertions/dom.rb
index 6c61d4e61a..8f90a1223e 100644
--- a/actionpack/lib/action_dispatch/testing/assertions/dom.rb
+++ b/actionpack/lib/action_dispatch/testing/assertions/dom.rb
@@ -20,7 +20,7 @@ module ActionDispatch
       def assert_dom_not_equal(expected, actual, message = "")
         expected_dom = HTML::Document.new(expected).root
         actual_dom   = HTML::Document.new(actual).root
-        refute_equal expected_dom, actual_dom
+        assert_not_equal expected_dom, actual_dom
       end
     end
   end
diff --git a/actionpack/test/controller/live_stream_test.rb b/actionpack/test/controller/live_stream_test.rb
index 20e433d1ec..3b1a07d7af 100644
--- a/actionpack/test/controller/live_stream_test.rb
+++ b/actionpack/test/controller/live_stream_test.rb
@@ -40,7 +40,7 @@ module ActionController
 
       def thread_locals
         tc.assert_equal 'aaron', Thread.current[:setting]
-        tc.refute_equal Thread.current.object_id, Thread.current[:originating_thread]
+        tc.assert_not_equal Thread.current.object_id, Thread.current[:originating_thread]
 
         response.headers['Content-Type'] = 'text/event-stream'
         %w{ hello world }.each do |word|
diff --git a/actionpack/test/dispatch/live_response_test.rb b/actionpack/test/dispatch/live_response_test.rb
index e16f23914b..e0cfb73acf 100644
--- a/actionpack/test/dispatch/live_response_test.rb
+++ b/actionpack/test/dispatch/live_response_test.rb
@@ -11,7 +11,7 @@ module ActionController
       def test_header_merge
         header = @response.header.merge('Foo' => 'Bar')
         assert_kind_of(ActionController::Live::Response::Header, header)
-        refute_equal header, @response.header
+        assert_not_equal header, @response.header
       end
 
       def test_initialize_with_default_headers
diff --git a/actionpack/test/dispatch/request/session_test.rb b/actionpack/test/dispatch/request/session_test.rb
index 3f36d4f1a9..1517f96fdc 100644
--- a/actionpack/test/dispatch/request/session_test.rb
+++ b/actionpack/test/dispatch/request/session_test.rb
@@ -24,7 +24,7 @@ module ActionDispatch
         s['foo'] = 'bar'
 
         s1 = Session.create(store, env, {})
-        refute_equal s, s1
+        assert_not_equal s, s1
         assert_equal 'bar', s1['foo']
       end
 
diff --git a/actionpack/test/dispatch/session/abstract_store_test.rb b/actionpack/test/dispatch/session/abstract_store_test.rb
index 8daf3d3f5e..fe1a7b4f86 100644
--- a/actionpack/test/dispatch/session/abstract_store_test.rb
+++ b/actionpack/test/dispatch/session/abstract_store_test.rb
@@ -42,7 +42,7 @@ module ActionDispatch
         as.call(@env)
         session1 = Request::Session.find @env
 
-        refute_equal session, session1
+        assert_not_equal session, session1
         assert_equal session.to_hash, session1.to_hash
       end
 
diff --git a/actionpack/test/dispatch/ssl_test.rb b/actionpack/test/dispatch/ssl_test.rb
index 6f075a9074..b4a39219bf 100644
--- a/actionpack/test/dispatch/ssl_test.rb
+++ b/actionpack/test/dispatch/ssl_test.rb
@@ -47,7 +47,7 @@ class SSLTest < ActionDispatch::IntegrationTest
   def test_disable_hsts_header
     self.app = ActionDispatch::SSL.new(default_app, :hsts => false)
     get "https://example.org/"
-    refute response.headers['Strict-Transport-Security']
+    assert_not response.headers['Strict-Transport-Security']
   end
 
   def test_hsts_expires
diff --git a/actionpack/test/journey/gtg/transition_table_test.rb b/actionpack/test/journey/gtg/transition_table_test.rb
index 6d81b72c41..133c9abe13 100644
--- a/actionpack/test/journey/gtg/transition_table_test.rb
+++ b/actionpack/test/journey/gtg/transition_table_test.rb
@@ -29,7 +29,7 @@ module ActionDispatch
             }
             svg = table.to_svg
             assert svg
-            refute_match(/DOCTYPE/, svg)
+            assert_no_match(/DOCTYPE/, svg)
           end
         end
 
@@ -53,7 +53,7 @@ module ActionDispatch
           sim = simulator_for ['/foo(/bar)']
           assert_match sim, '/foo'
           assert_match sim, '/foo/bar'
-          refute_match sim, '/foo/'
+          assert_no_match sim, '/foo/'
         end
 
         def test_match_data
diff --git a/actionpack/test/journey/nfa/simulator_test.rb b/actionpack/test/journey/nfa/simulator_test.rb
index 9f89329b57..f4fd6ec048 100644
--- a/actionpack/test/journey/nfa/simulator_test.rb
+++ b/actionpack/test/journey/nfa/simulator_test.rb
@@ -11,17 +11,17 @@ module ActionDispatch
 
         def test_simulate_simple_no_match
           sim = simulator_for ['/foo']
-          refute_match sim, 'foo'
+          assert_no_match sim, 'foo'
         end
 
         def test_simulate_simple_no_match_too_long
           sim = simulator_for ['/foo']
-          refute_match sim, '/foo/bar'
+          assert_no_match sim, '/foo/bar'
         end
 
         def test_simulate_simple_no_match_wrong_string
           sim = simulator_for ['/foo']
-          refute_match sim, '/bar'
+          assert_no_match sim, '/bar'
         end
 
         def test_simulate_regex
@@ -34,14 +34,14 @@ module ActionDispatch
           sim = simulator_for ['/foo', '/bar']
           assert_match sim, '/bar'
           assert_match sim, '/foo'
-          refute_match sim, '/baz'
+          assert_no_match sim, '/baz'
         end
 
         def test_simulate_optional
           sim = simulator_for ['/foo(/bar)']
           assert_match sim, '/foo'
           assert_match sim, '/foo/bar'
-          refute_match sim, '/foo/'
+          assert_no_match sim, '/foo/'
         end
 
         def test_matchdata_has_memos
diff --git a/actionpack/test/journey/nodes/symbol_test.rb b/actionpack/test/journey/nodes/symbol_test.rb
index f53840274a..caf797c4c6 100644
--- a/actionpack/test/journey/nodes/symbol_test.rb
+++ b/actionpack/test/journey/nodes/symbol_test.rb
@@ -9,7 +9,7 @@ module ActionDispatch
           assert sym.default_regexp?
 
           sym.regexp = nil
-          refute sym.default_regexp?
+          assert_not sym.default_regexp?
         end
       end
     end
diff --git a/actionpack/test/journey/path/pattern_test.rb b/actionpack/test/journey/path/pattern_test.rb
index 0f2d0d44c0..a42a29b4ee 100644
--- a/actionpack/test/journey/path/pattern_test.rb
+++ b/actionpack/test/journey/path/pattern_test.rb
@@ -88,7 +88,7 @@ module ActionDispatch
           path = Pattern.new strexp
           assert_match(path, '/page/tender')
           assert_match(path, '/page/love')
-          refute_match(path, '/page/loving')
+          assert_no_match(path, '/page/loving')
         end
 
         def test_optional_names
@@ -110,7 +110,7 @@ module ActionDispatch
           )
           path = Pattern.new strexp
           assert_match(path, '/123')
-          refute_match(path, '/')
+          assert_no_match(path, '/')
         end
 
         def test_to_regexp_with_group
@@ -122,7 +122,7 @@ module ActionDispatch
           path = Pattern.new strexp
           assert_match(path, '/page/tender')
           assert_match(path, '/page/love')
-          refute_match(path, '/page/loving')
+          assert_no_match(path, '/page/loving')
         end
 
         def test_ast_sets_regular_expressions
@@ -189,7 +189,7 @@ module ActionDispatch
           path = Pattern.new strexp
           assert_match(path, '/page/TENDER/aaron')
           assert_match(path, '/page/loVE/aaron')
-          refute_match(path, '/page/loVE/AAron')
+          assert_no_match(path, '/page/loVE/AAron')
         end
 
         def test_to_regexp_with_strexp
@@ -210,7 +210,7 @@ module ActionDispatch
           path = Pattern.new '/:controller(/:action(/:id(.:format)))'
           uri = 'content'
 
-          refute path =~ uri
+          assert_not path =~ uri
         end
 
         def test_match_controller
diff --git a/actionpack/test/journey/route_test.rb b/actionpack/test/journey/route_test.rb
index b205db5fbc..79895e1aaf 100644
--- a/actionpack/test/journey/route_test.rb
+++ b/actionpack/test/journey/route_test.rb
@@ -92,7 +92,7 @@ module ActionDispatch
 
         routes = [specific, generic]
 
-        refute_equal specific.score(knowledge), generic.score(knowledge)
+        assert_not_equal specific.score(knowledge), generic.score(knowledge)
 
         found = routes.sort_by { |r| r.score(knowledge) }.last
 
diff --git a/actionpack/test/journey/router_test.rb b/actionpack/test/journey/router_test.rb
index 1b64600ba8..e43d415e3f 100644
--- a/actionpack/test/journey/router_test.rb
+++ b/actionpack/test/journey/router_test.rb
@@ -277,7 +277,7 @@ module ActionDispatch
         @router.recognize(env) do |*whatever|
           yielded = true
         end
-        refute yielded
+        assert_not yielded
       end
 
       def test_required_part_in_recall
diff --git a/actionpack/test/journey/routes_test.rb b/actionpack/test/journey/routes_test.rb
index 3b17bd53b7..017c0eaee6 100644
--- a/actionpack/test/journey/routes_test.rb
+++ b/actionpack/test/journey/routes_test.rb
@@ -23,7 +23,7 @@ module ActionDispatch
         routes.add_route nil, path, {}, {}, {}
         ast = routes.ast
         routes.add_route nil, path, {}, {}, {}
-        refute_equal ast, routes.ast
+        assert_not_equal ast, routes.ast
       end
 
       def test_simulator_changes
@@ -33,7 +33,7 @@ module ActionDispatch
         routes.add_route nil, path, {}, {}, {}
         sim = routes.simulator
         routes.add_route nil, path, {}, {}, {}
-        refute_equal sim, routes.simulator
+        assert_not_equal sim, routes.simulator
       end
 
       def test_first_name_wins
-- 
cgit v1.2.3