aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-05-16 13:41:54 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-05-16 13:41:54 -0700
commit9fef7c8dc9e2880932d676ee663adc0f053bd089 (patch)
tree199d5f621971f1c0f2a2a1b3fd17c7e4cf7981a7 /activesupport/test
parent28574961fb5a6cdc7cdf420e1e3694653619bb5b (diff)
parentde4dcacc200f9bfa79f3c2e13b2091e3d5262f6d (diff)
downloadrails-9fef7c8dc9e2880932d676ee663adc0f053bd089.tar.gz
rails-9fef7c8dc9e2880932d676ee663adc0f053bd089.tar.bz2
rails-9fef7c8dc9e2880932d676ee663adc0f053bd089.zip
Merge pull request #10527 from zenspider/squishy_minitest5
Squishy minitest5
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/test_case_test.rb110
-rw-r--r--activesupport/test/test_test.rb2
2 files changed, 1 insertions, 111 deletions
diff --git a/activesupport/test/test_case_test.rb b/activesupport/test/test_case_test.rb
index a1bdcf2396..08df67827e 100644
--- a/activesupport/test/test_case_test.rb
+++ b/activesupport/test/test_case_test.rb
@@ -2,116 +2,6 @@ require 'abstract_unit'
module ActiveSupport
class TestCaseTest < ActiveSupport::TestCase
- class FakeRunner
- attr_reader :puked
-
- def initialize
- @puked = []
- end
-
- def puke(klass, name, e)
- @puked << [klass, name, e]
- end
-
- def options
- nil
- end
-
- def record(*args)
- end
-
- def info_signal
- end
- end
-
- def test_standard_error_raised_within_setup_callback_is_puked
- tc = Class.new(TestCase) do
- def self.name; nil; end
-
- setup :bad_callback
- def bad_callback; raise 'oh noes' end
- def test_true; assert true end
- end
-
- test_name = 'test_true'
- fr = FakeRunner.new
-
- test = tc.new test_name
- test.run fr
- klass, name, exception = *fr.puked.first
-
- assert_equal tc, klass
- assert_equal test_name, name
- assert_equal 'oh noes', exception.message
- end
-
- def test_standard_error_raised_within_teardown_callback_is_puked
- tc = Class.new(TestCase) do
- def self.name; nil; end
-
- teardown :bad_callback
- def bad_callback; raise 'oh noes' end
- def test_true; assert true end
- end
-
- test_name = 'test_true'
- fr = FakeRunner.new
-
- test = tc.new test_name
- test.run fr
- klass, name, exception = *fr.puked.first
-
- assert_equal tc, klass
- assert_equal test_name, name
- assert_equal 'oh noes', exception.message
- end
-
- def test_passthrough_exception_raised_within_test_method_is_not_rescued
- tc = Class.new(TestCase) do
- def self.name; nil; end
-
- def test_which_raises_interrupt; raise Interrupt; end
- end
-
- test_name = 'test_which_raises_interrupt'
- fr = FakeRunner.new
-
- test = tc.new test_name
- assert_raises(Interrupt) { test.run fr }
- end
-
- def test_passthrough_exception_raised_within_setup_callback_is_not_rescued
- tc = Class.new(TestCase) do
- def self.name; nil; end
-
- setup :callback_which_raises_interrupt
- def callback_which_raises_interrupt; raise Interrupt; end
- def test_true; assert true end
- end
-
- test_name = 'test_true'
- fr = FakeRunner.new
-
- test = tc.new test_name
- assert_raises(Interrupt) { test.run fr }
- end
-
- def test_passthrough_exception_raised_within_teardown_callback_is_not_rescued
- tc = Class.new(TestCase) do
- def self.name; nil; end
-
- teardown :callback_which_raises_interrupt
- def callback_which_raises_interrupt; raise Interrupt; end
- def test_true; assert true end
- end
-
- test_name = 'test_true'
- fr = FakeRunner.new
-
- test = tc.new test_name
- assert_raises(Interrupt) { test.run fr }
- end
-
def test_pending_deprecation
assert_deprecated do
pending "should use #skip instead"
diff --git a/activesupport/test/test_test.rb b/activesupport/test/test_test.rb
index 3e6ac811a4..68f9ec6c00 100644
--- a/activesupport/test/test_test.rb
+++ b/activesupport/test/test_test.rb
@@ -201,6 +201,6 @@ class TestCaseTaggedLoggingTest < ActiveSupport::TestCase
end
def test_logs_tagged_with_current_test_case
- assert_match "#{self.class}: #{__name__}\n", @out.string
+ assert_match "#{self.class}: #{name}\n", @out.string
end
end