mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
564b162015
With this we can perform new assertions on the returned value without having to cache it with an outer variable or wrapping all subsequent assertions inside the `assert_difference` block. Before: ``` post = nil assert_difference -> { Post.count }, 1 do Post.create end assert_predicate post, :persisted? ``` Now: ``` post = assert_difference -> { Post.count } do Post.create end assert_predicate post, :persisted? ``` |
||
---|---|---|
.. | ||
active_support | ||
active_support.rb |