1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activesupport/lib/active_support/testing
Lucas Mazza 564b162015 Make assert_difference return the result of the yielded block.
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?
```
2015-09-24 14:17:49 -03:00
..
assertions.rb Make assert_difference return the result of the yielded block. 2015-09-24 14:17:49 -03:00
autorun.rb inline test runner check into as/testing/autorun.rb. 2015-06-11 10:50:10 +02:00
composite_filter.rb Improve test runner's Minitest integration. 2015-06-04 20:57:08 +02:00
constant_lookup.rb Use safe_constantize. 2014-09-02 00:41:00 +08:00
declarative.rb remove deprecated code. Rely on describe provided by minitest 2014-06-10 17:14:57 -07:00
deprecation.rb make collect_deprecations available. 2013-12-10 15:22:31 +01:00
file_fixtures.rb introduce ActiveSupport::Testing::FileFixtures. 2015-01-28 12:29:34 +01:00
isolation.rb MRI compatible code for ActiveSupport::Testing::Isolation::Subprocess 2015-04-19 12:18:16 +08:00
method_call_assertions.rb Cleaned up generators tests using internal assertion helper 2015-08-20 09:22:56 +05:30
setup_and_teardown.rb add documentation for ActiveSupport::Testing::SetupAndTeardown. 2013-06-19 14:45:49 +02:00
stream.rb - Extracted silence_stream method to new module in activesupport/testing. 2015-01-20 22:28:48 +05:30
tagged_logging.rb Prefer to pass block when logging. 2014-07-18 15:04:43 +08:00
time_helpers.rb A few documentation tweaks [ci skip] 2015-06-07 14:53:24 +02:00