File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
activesupport/test/cache/behaviors Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -9,17 +9,19 @@ def test_fetch_read_failure_returns_nil
9
9
end
10
10
end
11
11
12
- ##
13
- # Though the `write` part of fetch fails for the same reason
14
- # `read` will, the block result is still executed and returned.
15
- def test_fetch_read_failure_returns_block_result
12
+ def test_fetch_read_failure_does_not_attempt_to_write
16
13
@cache . write ( "foo" , "bar" )
17
14
18
15
emulating_unavailability do |cache |
19
- val = cache . fetch ( "foo" ) { '1' }
16
+ val = cache . fetch ( "foo" ) { "1" }
20
17
21
- assert_equal '1' , val
18
+ ##
19
+ # Though the `write` part of fetch fails for the same reason
20
+ # `read` will, the block result is still executed and returned.
21
+ assert_equal "1" , val
22
22
end
23
+
24
+ assert_equal "bar" , @cache . read ( "foo" )
23
25
end
24
26
25
27
def test_read_failure_returns_nil
You can’t perform that action at this time.
0 commit comments