| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
| |
Add tests for ActiveSupport::Deprecation.deprecate_methods
Modify ActiveSupport::Testing::Deprecation to allow a custom deprecator
Leverage ActiveSupport::Testing::Deprecation assert_deprecated
Update documentation for ActiveSupport::Deprecation.deprecate_methods
Use cases:
Using the default deprecator => "removed from Rails X.Y"
Passing a custom deprecator in the options hash => "removed from MyGem next-release"
Deprecating methods directly from custom deprecator => "removed from MyGem next-release"
|
|
|
|
|
| |
this should fix the error where isolation tests raise an exception and
we just get a marshal error
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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?
```
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Add `assert_called` and `assert_not_called` to boil down the boilerplate we need to write
to assert methods are called certain number of times.
|
|
|
|
|
| |
This makes it possible to easily get the runner working with existing
setups that rely on `active_support/testing/autorun.rb`.
|
|\
| |
| |
| | |
Improve Test Runner's Minitest integration.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This also adds free mix and matching of directories, files and lines filters.
Like so:
bin/rails test models/post_test.rb test/integration models/person_test.rb:26
You can also mix in a traditional Minitest filter:
bin/rails test test/integration -n /check_it_out/
|
|/
|
|
| |
[Robin Dupret & Shunsuke Aida]
|
| |
|
|
|
|
| |
[ci skip]
|
| |
|
| |
|
| |
|
|\
| |
| | |
Extracted silence_stream method to new module in activesupport/testing
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Added include for the same in ActiveSupport::Test.
- Removed occurrences of silence_stream being used elsewhere.
- Reordered activesupport testcase requires alphabetically.
- Removed require of silence stream from test_case
- Moved quietly method to stream helper
- Moved capture output to stream helper module and setup requires for the same elsewhere
|
| | |
|
|/
|
|
|
|
| |
It's a thin layer to provide easy access to sample files throughout
test-cases. This adds the directory `test/fixtures/files` to newly
generated applications.
|
|
|
|
|
| |
Process.respond_to?(:fork) returns false if fork is not available.
More on http://www.ruby-doc.org/core-2.0.0/Process.html#method-c-fork
|
| |
|
|
|
|
|
|
| |
claudiob/replace-slower-block-call-with-faster-yield
Replace (slower) block.call with (faster) yield
|
|
|
|
| |
This reverts commit 0ab075e75f58bf403f7ebe20546c7005f35db1f6.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Performance optimization: `yield` with an implicit `block` is faster than `block.call`.
See http://youtu.be/fGFM_UrSp70?t=10m35s and the following benchmark:
```ruby
require 'benchmark/ips'
def fast
yield
end
def slow(&block)
block.call
end
Benchmark.ips do |x|
x.report('fast') { fast{} }
x.report('slow') { slow{} }
end
# => fast 154095 i/100ms
# => slow 71454 i/100ms
# =>
# => fast 7511067.8 (±5.0%) i/s - 37445085 in 4.999660s
# => slow 1227576.9 (±6.8%) i/s - 6145044 in 5.028356s
```
|
|
|
|
| |
Fixes https://github.com/rails/rails/issues/9933.
|
|
|
|
| |
to zero, so we only travel with per-second precision, not anything deeper than that.
|
|
|
|
|
|
|
|
| |
The Logger by default includes a guard which checks for the
logging level. By removing the custom logging guards, we can decouple
the logging guard from the logging action to be done.
This also follows the good practice listed on http://guides.rubyonrails.org/debugging_rails_applications.html#impact-of-logs-on-performance.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As there is no forking on JRuby, we need to spawn sub-processes to make
the tests run in isolation.
Previously, we were defining globally env variables and running the test
file through backticks and delete these variables once the test ran.
Now, we simply rely on IO.popen as this is cross-platform and the env
variables are available during the child-process execution only so there
are no race conditions.
[Ben Browning & Robin Dupret]
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rails applications are expected to be always aware of the application
time zone.
To be consistent with that contract, we have to assume that a bare
date passed to time helpers is a date in the application time zone,
not in the system time zone. The system time zone is irrelevant, we
should totally ignore it.
For example,
travel_to user.birth_date + 40.years
should make that user be 40th years old regardless of the system
time zone. Without this patch that may not be true.
|
| |
|
|
|
|
|
|
| |
This behavior is only work out-of-box with minitest and also add a
downside to run after each test case, even if we don't used the travel
or travel_to methods
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Using parallelize_me! to parallelize isolated test
|
| |
| |
| |
| |
| | |
As ParallelEach is no more available
related commit ec00442c10cb90796909e876fb1cc557ed7518bd
|