diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-06 20:20:22 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-08-06 20:20:22 +0200 |
commit | b326e82dc012d81e9698cb1f402502af1788c1e9 (patch) | |
tree | 6b6452129a5b6b684f3d44f21afd2b1bea83fa22 /activesupport/test | |
parent | 80e66cc4d90bf8c15d1a5f6e3152e90147f00772 (diff) | |
download | rails-b326e82dc012d81e9698cb1f402502af1788c1e9.tar.gz rails-b326e82dc012d81e9698cb1f402502af1788c1e9.tar.bz2 rails-b326e82dc012d81e9698cb1f402502af1788c1e9.zip |
applies remaining conventions across the project
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/broadcast_logger_test.rb | 2 | ||||
-rw-r--r-- | activesupport/test/callbacks_test.rb | 2 | ||||
-rw-r--r-- | activesupport/test/clean_backtrace_test.rb | 1 | ||||
-rw-r--r-- | activesupport/test/core_ext/module/remove_method_test.rb | 2 | ||||
-rw-r--r-- | activesupport/test/core_ext/object/deep_dup_test.rb | 2 | ||||
-rw-r--r-- | activesupport/test/deprecation_test.rb | 1 | ||||
-rw-r--r-- | activesupport/test/json/decoding_test.rb | 20 | ||||
-rw-r--r-- | activesupport/test/message_verifier_test.rb | 1 | ||||
-rw-r--r-- | activesupport/test/multibyte_unicode_database_test.rb | 1 | ||||
-rw-r--r-- | activesupport/test/number_helper_test.rb | 2 | ||||
-rw-r--r-- | activesupport/test/xml_mini/rexml_engine_test.rb | 1 |
11 files changed, 11 insertions, 24 deletions
diff --git a/activesupport/test/broadcast_logger_test.rb b/activesupport/test/broadcast_logger_test.rb index 465dc8e8e1..4b74f1313e 100644 --- a/activesupport/test/broadcast_logger_test.rb +++ b/activesupport/test/broadcast_logger_test.rb @@ -138,7 +138,7 @@ module ActiveSupport add(::Logger::UNKNOWN, message, &block) end - def << x + def <<(x) @chevrons << x end diff --git a/activesupport/test/callbacks_test.rb b/activesupport/test/callbacks_test.rb index ac2c539f66..040e9c1cca 100644 --- a/activesupport/test/callbacks_test.rb +++ b/activesupport/test/callbacks_test.rb @@ -361,7 +361,6 @@ module CallbacksTest end class ExtendCallbacks - include ActiveSupport::Callbacks define_callbacks :save @@ -453,7 +452,6 @@ module CallbacksTest end class CallbacksTest < ActiveSupport::TestCase - def test_save_person person = Person.new assert_equal [], person.history diff --git a/activesupport/test/clean_backtrace_test.rb b/activesupport/test/clean_backtrace_test.rb index 0069d0959f..5ed518cdb0 100644 --- a/activesupport/test/clean_backtrace_test.rb +++ b/activesupport/test/clean_backtrace_test.rb @@ -20,7 +20,6 @@ class BacktraceCleanerFilterTest < ActiveSupport::TestCase test "backtrace should contain unaltered lines if they dont match a filter" do assert_equal "/my/other_prefix/my/class.rb", @bc.clean([ "/my/other_prefix/my/class.rb" ]).first end - end class BacktraceCleanerSilencerTest < ActiveSupport::TestCase diff --git a/activesupport/test/core_ext/module/remove_method_test.rb b/activesupport/test/core_ext/module/remove_method_test.rb index c731d08026..6579b2754f 100644 --- a/activesupport/test/core_ext/module/remove_method_test.rb +++ b/activesupport/test/core_ext/module/remove_method_test.rb @@ -26,7 +26,6 @@ module RemoveMethodTests end class RemoveMethodTest < ActiveSupport::TestCase - def test_remove_method_from_an_object RemoveMethodTests::A.class_eval{ self.remove_possible_method(:do_something) @@ -55,5 +54,4 @@ class RemoveMethodTest < ActiveSupport::TestCase assert RemoveMethodTests::A.protected_method_defined? :do_something_protected assert RemoveMethodTests::A.private_method_defined? :do_something_private end - end diff --git a/activesupport/test/core_ext/object/deep_dup_test.rb b/activesupport/test/core_ext/object/deep_dup_test.rb index 2c0526eebf..e335ec1b40 100644 --- a/activesupport/test/core_ext/object/deep_dup_test.rb +++ b/activesupport/test/core_ext/object/deep_dup_test.rb @@ -2,7 +2,6 @@ require "abstract_unit" require "active_support/core_ext/object" class DeepDupTest < ActiveSupport::TestCase - def test_array_deep_dup array = [1, [2, 3]] dup = array.deep_dup @@ -55,5 +54,4 @@ class DeepDupTest < ActiveSupport::TestCase dup = hash.deep_dup assert_equal 1, dup.keys.length end - end diff --git a/activesupport/test/deprecation_test.rb b/activesupport/test/deprecation_test.rb index b9447d74b4..36c3a44c31 100644 --- a/activesupport/test/deprecation_test.rb +++ b/activesupport/test/deprecation_test.rb @@ -370,5 +370,4 @@ class DeprecationTest < ActiveSupport::TestCase end deprecator end - end diff --git a/activesupport/test/json/decoding_test.rb b/activesupport/test/json/decoding_test.rb index 97cc508268..de314921ec 100644 --- a/activesupport/test/json/decoding_test.rb +++ b/activesupport/test/json/decoding_test.rb @@ -46,10 +46,10 @@ class TestJSONDecoding < ActiveSupport::TestCase %({"a": null}) => {"a" => nil}, %({"a": true}) => {"a" => true}, %({"a": false}) => {"a" => false}, - %q({"bad":"\\\\","trailing":""}) => {"bad" => "\\", "trailing" => ""}, + '{"bad":"\\\\","trailing":""}' => {"bad" => "\\", "trailing" => ""}, %q({"a": "http:\/\/test.host\/posts\/1"}) => {"a" => "http://test.host/posts/1"}, %q({"a": "\u003cunicode\u0020escape\u003e"}) => {"a" => "<unicode escape>"}, - %q({"a": "\\\\u0020skip double backslashes"}) => {"a" => "\\u0020skip double backslashes"}, + '{"a": "\\\\u0020skip double backslashes"}' => {"a" => "\\u0020skip double backslashes"}, %q({"a": "\u003cbr /\u003e"}) => {"a" => "<br />"}, %q({"b":["\u003ci\u003e","\u003cb\u003e","\u003cu\u003e"]}) => {"b" => ["<i>","<b>","<u>"]}, # test combination of dates and escaped or unicode encoded data in arrays @@ -63,15 +63,15 @@ class TestJSONDecoding < ActiveSupport::TestCase %q({"a":"\u000a"}) => {"a"=>"\n"}, %q({"a":"Line1\u000aLine2"}) => {"a"=>"Line1\nLine2"}, # prevent json unmarshalling - %q({"json_class":"TestJSONDecoding::Foo"}) => {"json_class"=>"TestJSONDecoding::Foo"}, + '{"json_class":"TestJSONDecoding::Foo"}' => {"json_class"=>"TestJSONDecoding::Foo"}, # json "fragments" - these are invalid JSON, but ActionPack relies on this - %q("a string") => "a string", - %q(1.1) => 1.1, - %q(1) => 1, - %q(-1) => -1, - %q(true) => true, - %q(false) => false, - %q(null) => nil + '"a string"' => "a string", + "1.1" => 1.1, + "1" => 1, + "-1" => -1, + "true" => true, + "false" => false, + "null" => nil } TESTS.each_with_index do |(json, expected), index| diff --git a/activesupport/test/message_verifier_test.rb b/activesupport/test/message_verifier_test.rb index a29727608d..d56a46b250 100644 --- a/activesupport/test/message_verifier_test.rb +++ b/activesupport/test/message_verifier_test.rb @@ -4,7 +4,6 @@ require "active_support/time" require "active_support/json" class MessageVerifierTest < ActiveSupport::TestCase - class JSONSerializer def dump(value) ActiveSupport::JSON.encode(value) diff --git a/activesupport/test/multibyte_unicode_database_test.rb b/activesupport/test/multibyte_unicode_database_test.rb index 267e3e1427..924db303b6 100644 --- a/activesupport/test/multibyte_unicode_database_test.rb +++ b/activesupport/test/multibyte_unicode_database_test.rb @@ -2,7 +2,6 @@ require "abstract_unit" class MultibyteUnicodeDatabaseTest < ActiveSupport::TestCase - include ActiveSupport::Multibyte::Unicode def setup diff --git a/activesupport/test/number_helper_test.rb b/activesupport/test/number_helper_test.rb index c25a3dedf7..cd6f9ad234 100644 --- a/activesupport/test/number_helper_test.rb +++ b/activesupport/test/number_helper_test.rb @@ -5,7 +5,6 @@ require "active_support/core_ext/string/output_safety" module ActiveSupport module NumberHelper class NumberHelperTest < ActiveSupport::TestCase - class TestClassWithInstanceNumberHelpers include ActiveSupport::NumberHelper end @@ -416,7 +415,6 @@ module ActiveSupport assert_equal "x", number_helper.number_to_human("x") end end - end end end diff --git a/activesupport/test/xml_mini/rexml_engine_test.rb b/activesupport/test/xml_mini/rexml_engine_test.rb index a3bae7a89c..e616b73162 100644 --- a/activesupport/test/xml_mini/rexml_engine_test.rb +++ b/activesupport/test/xml_mini/rexml_engine_test.rb @@ -41,5 +41,4 @@ class REXMLEngineTest < ActiveSupport::TestCase xml_string = "<root></root>".freeze assert_equal({"root" => {}}, ActiveSupport::XmlMini.parse(xml_string)) end - end |