diff options
author | Tara Scherner de la Fuente <tara.scherner@livingsocial.com> | 2016-02-19 20:05:49 -0800 |
---|---|---|
committer | Tara Scherner de la Fuente <tara.scherner@livingsocial.com> | 2016-02-22 22:56:23 -0800 |
commit | 926a24a7510be3d7f611c03feaf83f50d36076e8 (patch) | |
tree | 2a0ebb41c6f3eea9456bff1d7ebd79ac647dd6bd /activesupport | |
parent | 42ad173d19a2220996ec4172d05681bde2e7320b (diff) | |
download | rails-926a24a7510be3d7f611c03feaf83f50d36076e8.tar.gz rails-926a24a7510be3d7f611c03feaf83f50d36076e8.tar.bz2 rails-926a24a7510be3d7f611c03feaf83f50d36076e8.zip |
remove args from assert_nothing_raised in tests
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/test_case.rb | 2 | ||||
-rw-r--r-- | activesupport/test/caching_test.rb | 4 | ||||
-rw-r--r-- | activesupport/test/core_ext/marshal_test.rb | 2 | ||||
-rw-r--r-- | activesupport/test/core_ext/time_ext_test.rb | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb index 4dc84e4a59..221e1171e7 100644 --- a/activesupport/lib/active_support/test_case.rb +++ b/activesupport/lib/active_support/test_case.rb @@ -74,7 +74,7 @@ module ActiveSupport # assert_nothing_raised do # perform_service(param: 'no_exception') # end - def assert_nothing_raised(*args) + def assert_nothing_raised yield end end diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index 39fa3cedbe..9e744afb2b 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -836,7 +836,7 @@ class FileStoreTest < ActiveSupport::TestCase # If nothing has been stored in the cache, there is a chance the cache directory does not yet exist # Ensure delete_matched gracefully handles this case def test_delete_matched_when_cache_directory_does_not_exist - assert_nothing_raised(Exception) do + assert_nothing_raised do ActiveSupport::Cache::FileStore.new('/test/cache/directory').delete_matched(/does_not_exist/) end end @@ -844,7 +844,7 @@ class FileStoreTest < ActiveSupport::TestCase def test_delete_does_not_delete_empty_parent_dir sub_cache_dir = File.join(cache_dir, 'subdir/') sub_cache_store = ActiveSupport::Cache::FileStore.new(sub_cache_dir) - assert_nothing_raised(Exception) do + assert_nothing_raised do assert sub_cache_store.write('foo', 'bar') assert sub_cache_store.delete('foo') end diff --git a/activesupport/test/core_ext/marshal_test.rb b/activesupport/test/core_ext/marshal_test.rb index 825df439a5..5427837d19 100644 --- a/activesupport/test/core_ext/marshal_test.rb +++ b/activesupport/test/core_ext/marshal_test.rb @@ -96,7 +96,7 @@ class MarshalTest < ActiveSupport::TestCase Marshal.load(dumped) end - assert_nothing_raised("EM failed to load while we expect only SomeClass to fail loading") do + assert_nothing_raised do EM.new end diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb index e45df63fd5..d8bb38621b 100644 --- a/activesupport/test/core_ext/time_ext_test.rb +++ b/activesupport/test/core_ext/time_ext_test.rb @@ -392,7 +392,7 @@ class TimeExtCalculationsTest < ActiveSupport::TestCase assert_equal Time.local(2005,1,2,11,22,33, 8), Time.local(2005,1,2,11,22,33,44).change(:usec => 8) assert_equal Time.local(2005,1,2,11,22,33, 8), Time.local(2005,1,2,11,22,33,2).change(:nsec => 8000) assert_raise(ArgumentError) { Time.local(2005,1,2,11,22,33, 8).change(:usec => 1, :nsec => 1) } - assert_nothing_raised(ArgumentError) { Time.new(2015, 5, 9, 10, 00, 00, '+03:00').change(nsec: 999999999) } + assert_nothing_raised { Time.new(2015, 5, 9, 10, 00, 00, '+03:00').change(nsec: 999999999) } end def test_utc_change |