Permalink
Browse files

Merge branch 'minitest_cleanup'

  • Loading branch information...
rafaelfranca committed Dec 31, 2012
2 parents 5e51074 + cf4afc4 commit b22c527e65a41da59dbfcb078968069c6fae5086
Showing with 147 additions and 718 deletions.
  1. +0 −7 actionmailer/lib/action_mailer/test_case.rb
  2. +1 −1 actionmailer/test/abstract_unit.rb
  3. +0 −37 actionmailer/test/spec_type_test.rb
  4. +0 −144 actionmailer/test/test_test.rb
  5. +0 −7 actionpack/lib/action_controller/test_case.rb
  6. +1 −1 actionpack/lib/action_dispatch/testing/assertions/dom.rb
  7. +0 −3 actionpack/lib/action_dispatch/testing/integration.rb
  8. +0 −3 actionpack/lib/action_view/test_case.rb
  9. +1 −1 actionpack/test/abstract_unit.rb
  10. +3 −3 actionpack/test/controller/http_token_authentication_test.rb
  11. +1 −1 actionpack/test/controller/live_stream_test.rb
  12. +0 −208 actionpack/test/controller/spec_style_test.rb
  13. +0 −37 actionpack/test/controller/spec_type_test.rb
  14. +1 −1 actionpack/test/dispatch/live_response_test.rb
  15. +1 −1 actionpack/test/dispatch/request/session_test.rb
  16. +1 −1 actionpack/test/dispatch/routing/inspector_test.rb
  17. +1 −1 actionpack/test/dispatch/session/abstract_store_test.rb
  18. +0 −41 actionpack/test/dispatch/spec_type_test.rb
  19. +1 −1 actionpack/test/dispatch/ssl_test.rb
  20. +2 −2 actionpack/test/journey/gtg/transition_table_test.rb
  21. +5 −5 actionpack/test/journey/nfa/simulator_test.rb
  22. +1 −1 actionpack/test/journey/nodes/symbol_test.rb
  23. +5 −5 actionpack/test/journey/path/pattern_test.rb
  24. +1 −1 actionpack/test/journey/route_test.rb
  25. +1 −1 actionpack/test/journey/router_test.rb
  26. +2 −2 actionpack/test/journey/routes_test.rb
  27. +0 −39 actionpack/test/template/spec_type_test.rb
  28. +0 −56 actionpack/test/template/test_test.rb
  29. +1 −1 actionpack/test/ts_isolated.rb
  30. +1 −1 activemodel/test/cases/helper.rb
  31. +1 −1 activerecord/test/cases/base_test.rb
  32. +5 −5 activerecord/test/cases/connection_adapters/abstract_adapter_test.rb
  33. +1 −2 activerecord/test/cases/helper.rb
  34. +7 −7 activerecord/test/cases/migration/change_schema_test.rb
  35. +1 −0 activerecord/test/cases/migration/change_table_test.rb
  36. +4 −4 activerecord/test/cases/migration/column_attributes_test.rb
  37. +3 −3 activerecord/test/cases/migration/index_test.rb
  38. +4 −4 activerecord/test/cases/migration/references_index_test.rb
  39. +8 −8 activerecord/test/cases/migration/references_statements_test.rb
  40. +2 −2 activerecord/test/cases/migration_test.rb
  41. +4 −4 activerecord/test/cases/migrator_test.rb
  42. +2 −2 activerecord/test/cases/transactions_test.rb
  43. +14 −28 activesupport/lib/active_support/test_case.rb
  44. +5 −0 activesupport/lib/active_support/testing/autorun.rb
  45. +40 −0 activesupport/lib/active_support/testing/declarative.rb
  46. +1 −1 activesupport/test/abstract_unit.rb
  47. +2 −2 activesupport/test/core_ext/thread_test.rb
  48. +0 −22 activesupport/test/spec_type_test.rb
  49. +1 −1 activesupport/test/string_inquirer_test.rb
  50. +1 −1 activesupport/test/ts_isolated.rb
  51. +3 −2 guides/source/contributing_to_ruby_on_rails.md
  52. +1 −1 railties/lib/rails/generators/test_unit/plugin/templates/test_helper.rb
  53. +1 −1 railties/lib/rails/test_help.rb
  54. +1 −1 railties/test/abstract_unit.rb
  55. +2 −1 railties/test/configuration/middleware_stack_proxy_test.rb
  56. +1 −1 railties/test/engine_test.rb
  57. +1 −1 railties/test/isolation/abstract_unit.rb
@@ -10,13 +10,6 @@ def initialize(name)
end
class TestCase < ActiveSupport::TestCase
-
- # Use AM::TestCase for the base class when describing a mailer
- register_spec_type(self) do |desc|
- Class === desc && desc < ActionMailer::Base
- end
- register_spec_type(/Mailer( ?Test)?\z/i, self)
-
module Behavior
extend ActiveSupport::Concern
@@ -8,7 +8,7 @@
Encoding.default_external = "UTF-8"
end
-require 'minitest/autorun'
+require 'active_support/testing/autorun'
require 'action_mailer'
require 'action_mailer/test_case'
@@ -1,37 +0,0 @@
-require 'abstract_unit'
-
-class NotificationMailer < ActionMailer::Base; end
-class Notifications < ActionMailer::Base; end
-
-class SpecTypeTest < ActiveSupport::TestCase
- def assert_mailer actual
- assert_equal ActionMailer::TestCase, actual
- end
-
- def refute_mailer actual
- refute_equal ActionMailer::TestCase, actual
- end
-
- def test_spec_type_resolves_for_class_constants
- assert_mailer MiniTest::Spec.spec_type(NotificationMailer)
- assert_mailer MiniTest::Spec.spec_type(Notifications)
- end
-
- def test_spec_type_resolves_for_matching_strings
- assert_mailer MiniTest::Spec.spec_type("WidgetMailer")
- assert_mailer MiniTest::Spec.spec_type("WidgetMailerTest")
- assert_mailer MiniTest::Spec.spec_type("Widget Mailer Test")
- # And is not case sensitive
- assert_mailer MiniTest::Spec.spec_type("widgetmailer")
- assert_mailer MiniTest::Spec.spec_type("widgetmailertest")
- assert_mailer MiniTest::Spec.spec_type("widget mailer test")
- end
-
- def test_spec_type_wont_match_non_space_characters
- refute_mailer MiniTest::Spec.spec_type("Widget Mailer\tTest")
- refute_mailer MiniTest::Spec.spec_type("Widget Mailer\rTest")
- refute_mailer MiniTest::Spec.spec_type("Widget Mailer\nTest")
- refute_mailer MiniTest::Spec.spec_type("Widget Mailer\fTest")
- refute_mailer MiniTest::Spec.spec_type("Widget MailerXTest")
- end
-end
@@ -26,147 +26,3 @@ def test_set_mailer_class_manual_using_string
assert_equal TestTestMailer, self.class.mailer_class
end
end
-
-describe TestTestMailer do
- it "gets the mailer from the test name" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe TestTestMailer, :action do
- it "gets the mailer from the test name" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe TestTestMailer do
- describe "nested" do
- it "gets the mailer from the test name" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
- end
-end
-
-describe TestTestMailer, :action do
- describe "nested" do
- it "gets the mailer from the test name" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
- end
-end
-
-describe "TestTestMailer" do
- it "gets the mailer from the test name" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe "TestTestMailerTest" do
- it "gets the mailer from the test name" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe "TestTestMailer" do
- describe "nested" do
- it "gets the mailer from the test name" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
- end
-end
-
-describe "TestTestMailerTest" do
- describe "nested" do
- it "gets the mailer from the test name" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
- end
-end
-
-describe "AnotherCrazySymbolNameMailerTest" do
- tests :test_test_mailer
-
- it "gets the mailer after setting it with a symbol" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe "AnotherCrazyStringNameMailerTest" do
- tests 'test_test_mailer'
-
- it "gets the mailer after setting it with a string" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe "Another Crazy Name Mailer Test" do
- tests TestTestMailer
-
- it "gets the mailer after setting it manually" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe "Another Crazy Symbol Name Mailer Test" do
- tests :test_test_mailer
-
- it "gets the mailer after setting it with a symbol" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe "Another Crazy String Name Mailer Test" do
- tests 'test_test_mailer'
-
- it "gets the mailer after setting it with a string" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe "AnotherCrazySymbolNameMailerTest" do
- tests :test_test_mailer
-
- describe "nested" do
- it "gets the mailer after setting it with a symbol" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
- end
-end
-
-describe "AnotherCrazyStringNameMailerTest" do
- tests 'test_test_mailer'
-
- describe "nested" do
- it "gets the mailer after setting it with a string" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
- end
-end
-
-describe "Another Crazy Name Mailer Test" do
- tests TestTestMailer
-
- describe "nested" do
- it "gets the mailer after setting it manually" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
- end
-end
-
-describe "Another Crazy Symbol Name Mailer Test" do
- tests :test_test_mailer
-
- describe "nested" do
- it "gets the mailer after setting it with a symbol" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
- end
-end
-
-describe "Another Crazy String Name Mailer Test" do
- tests 'test_test_mailer'
-
- it "gets the mailer after setting it with a string" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
@@ -360,13 +360,6 @@ def exists?
#
# assert_redirected_to page_url(title: 'foo')
class TestCase < ActiveSupport::TestCase
-
- # Use AC::TestCase for the base class when describing a controller
- register_spec_type(self) do |desc|
- Class === desc && desc < ActionController::Metal
- end
- register_spec_type(/Controller( ?Test)?\z/i, self)
-
module Behavior
extend ActiveSupport::Concern
include ActionDispatch::TestProcess
@@ -20,7 +20,7 @@ def assert_dom_equal(expected, actual, message = "")
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
@@ -491,9 +491,6 @@ class IntegrationTest < ActiveSupport::TestCase
include ActionController::TemplateAssertions
include ActionDispatch::Routing::UrlFor
- # Use AD::IntegrationTest for acceptance tests
- register_spec_type(/(Acceptance|Integration) ?Test\z/i, self)
-
@@app = nil
def self.app
@@ -30,9 +30,6 @@ def initialize
end
end
- # Use AV::TestCase for the base class for helpers and views
- register_spec_type(/(Helper|View)( ?Test)?\z/i, self)
-
module Behavior
extend ActiveSupport::Concern
@@ -15,7 +15,7 @@
Encoding.default_external = "UTF-8"
end
-require 'minitest/autorun'
+require 'active_support/testing/autorun'
require 'abstract_controller'
require 'action_controller'
require 'action_view'
@@ -111,21 +111,21 @@ def authenticate_long_credentials
assert_equal(expected, actual)
end
- test "token_and_options returns correct token" do
+ test "token_and_options returns correct token with value after the equal sign" do
token = 'rcHu+=HzSFw89Ypyhn/896A==f34'
actual = ActionController::HttpAuthentication::Token.token_and_options(sample_request(token)).first
expected = token
assert_equal(expected, actual)
end
- test "token_and_options returns correct token" do
+ test "token_and_options returns correct token with slashes" do
token = 'rcHu+\\\\"/896A'
actual = ActionController::HttpAuthentication::Token.token_and_options(sample_request(token)).first
expected = token
assert_equal(expected, actual)
end
- test "token_and_options returns correct token" do
+ test "token_and_options returns correct token with quotes" do
token = '\"quote\" pretty'
actual = ActionController::HttpAuthentication::Token.token_and_options(sample_request(token)).first
expected = token
@@ -40,7 +40,7 @@ def blocking_stream
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|
Oops, something went wrong.

1 comment on commit b22c527

@metaskills

This comment has been minimized.

Show comment Hide comment
@metaskills

metaskills Jan 2, 2013

Contributor

For anyone that does not like this. I will make sure minitest-spec-rails works just as cleanly on Rails 4.x.

Contributor

metaskills commented on b22c527 Jan 2, 2013

For anyone that does not like this. I will make sure minitest-spec-rails works just as cleanly on Rails 4.x.

Please sign in to comment.