aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/class_cache_test.rb
diff options
context:
space:
mode:
authorDaniel Colson <danieljamescolson@gmail.com>2018-01-25 18:16:57 -0500
committerDaniel Colson <danieljamescolson@gmail.com>2018-01-25 23:32:59 -0500
commit82c39e1a0b5114e2d89a80883a41090567a83196 (patch)
tree476f620e0224130ca3dca3ed4e9b5a58fb0d5da9 /activesupport/test/class_cache_test.rb
parent94333a4c31bd10c1f358c538a167e6a4589bae2d (diff)
downloadrails-82c39e1a0b5114e2d89a80883a41090567a83196.tar.gz
rails-82c39e1a0b5114e2d89a80883a41090567a83196.tar.bz2
rails-82c39e1a0b5114e2d89a80883a41090567a83196.zip
Use assert_empty and assert_not_empty
Diffstat (limited to 'activesupport/test/class_cache_test.rb')
-rw-r--r--activesupport/test/class_cache_test.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/activesupport/test/class_cache_test.rb b/activesupport/test/class_cache_test.rb
index c9c979b2f6..8cfcaedafd 100644
--- a/activesupport/test/class_cache_test.rb
+++ b/activesupport/test/class_cache_test.rb
@@ -11,17 +11,17 @@ module ActiveSupport
end
def test_empty?
- assert_predicate @cache, :empty?
+ assert_empty @cache
@cache.store(ClassCacheTest)
- assert_not_predicate @cache, :empty?
+ assert_not_empty @cache
end
def test_clear!
- assert_predicate @cache, :empty?
+ assert_empty @cache
@cache.store(ClassCacheTest)
- assert_not_predicate @cache, :empty?
+ assert_not_empty @cache
@cache.clear!
- assert_predicate @cache, :empty?
+ assert_empty @cache
end
def test_set_key
@@ -40,29 +40,29 @@ module ActiveSupport
end
def test_get_constantizes
- assert_predicate @cache, :empty?
+ assert_empty @cache
assert_equal ClassCacheTest, @cache.get(ClassCacheTest.name)
end
def test_get_constantizes_fails_on_invalid_names
- assert_predicate @cache, :empty?
+ assert_empty @cache
assert_raise NameError do
@cache.get("OmgTotallyInvalidConstantName")
end
end
def test_get_alias
- assert_predicate @cache, :empty?
+ assert_empty @cache
assert_equal @cache[ClassCacheTest.name], @cache.get(ClassCacheTest.name)
end
def test_safe_get_constantizes
- assert_predicate @cache, :empty?
+ assert_empty @cache
assert_equal ClassCacheTest, @cache.safe_get(ClassCacheTest.name)
end
def test_safe_get_constantizes_doesnt_fail_on_invalid_names
- assert_predicate @cache, :empty?
+ assert_empty @cache
assert_nil @cache.safe_get("OmgTotallyInvalidConstantName")
end