| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
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
|
|/
|
|
|
|
|
|
|
|
| |
There are circumstances where the capabilities of `assert_deprecated` and
`assert_not_deprecated` are not enough. For example if a ccertain call-path
raises two deprecations but should only raise a single one.
This module is still :nodoc and intented for internal use.
/cc @rafaelfranca
|
|
|
|
|
|
| |
https://github.com/seattlerb/minitest/commit/34760e3b268bc1bb4ac5fe1a44ef1ff0a2f9bd4d
This PR should fix build
|
|
|
|
|
| |
Provide message to define ActiveSupport::TestCase.name instead.
Allow calling describe with a block, which Minitest::Spec does.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add `ActiveSupport::Testing::TimeHelpers#travel` and `#travel_to`. These
methods change current time to the given time or time difference by
stubbing `Time.now` and `Date.today` to return the time or date after
the difference calculation, or the time or date that got passed into the
method respectively. These methods also accept a block, which will
return current time back to its original state at the end of the block.
Example for `#travel`:
Time.now # => 2013-11-09 15:34:49 -05:00
travel 1.day
Time.now # => 2013-11-10 15:34:49 -05:00
Date.today # => Sun, 10 Nov 2013
Example for `#travel_to`:
Time.now # => 2013-11-09 15:34:49 -05:00
travel_to Time.new(2004, 11, 24, 01, 04, 44)
Time.now # => 2004-11-24 01:04:44 -05:00
Date.today # => Wed, 24 Nov 2004
Both of these methods also accept a block, which will return the current
time back to its original state at the end of the block:
Time.now # => 2013-11-09 15:34:49 -05:00
travel 1.day do
User.create.created_at # => Sun, 10 Nov 2013 15:34:49 EST -05:00
end
travel_to Time.new(2004, 11, 24, 01, 04, 44) do
User.create.created_at # => Wed, 24 Nov 2004 01:04:44 EST -05:00
end
Time.now # => 2013-11-09 15:34:49 -05:00
This module is included in `ActiveSupport::TestCase` automatically.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hopefully the first of many related to #11700.
With these changes the railties tests wont 100% pass but at least they
will run and show the errors.
The first problem was the @method_name variable was never set.
This was causing ENV["ISOLATION_TEST"] to always be nil which
would cause the test output to never be written to the tempfile.
The second problem was that an invalid -t option was being passed
to minitest and minitest was erroring out.
The third problem was the run method needs to always return an
instance of the test class it is trying to isolate. We were returning
a ProxyTestResult instead.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
+ Namespace changes, overhaul of runners.
+ Internal ivar name changes
- Removed a logger globally applied to tests that spew everywhere?!?
+ Override Minitest#__run to sort tests by name.
+ Reworked testing isolation to work with the new cleaner architecture.
- Removed a bunch of tests that just test minitest straight up. I think these changes were all merged to minitest 4 a long time ago.
- Minor report output differences.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MiniTest 4.7.3 detects the presence of SIGINFO and stores the answer in
a constant.
It seems that MiniTest 4.7.4 changes this, and instead relies on an
info_signal method being implemented on the runner object.
In ActiveSupport::Testing::Isolation, we use ProxyTestResult to stand in
for the runner object. This object implements `method_missing`, and as
such its #info_signal method has a truthy return value. This results in
MiniTest trying to install the SIGINFO handler on platforms where
SIGINFO does not exists.
To fix, I am simply defining an explicit ProxyTestResult#info_signal
method.
|
| |
|
|
|
|
| |
ParallelEach
|
| |
|
|
|
|
| |
Minitest has changed to require this since https://github.com/seattlerb/minitest/commit/728054b
|
| |
|
|
|
|
|
| |
This may or may not fix the intermittent railties failures we've been
seeing on the CI with Ruby 2.0. We'll see.
|
| |
|
|
|
|
|
| |
They don't add any benefits over `assert object.blank?`
and `assert object.present?`
|
|
|
|
| |
method_missing with Marshal.dump and Marshal.load is changing in ruby 2.0.0 later.
|
|
|
|
|
| |
minitest/autorun load minitest/spec polluting the global namespace with
the DSL that we don't want on Rails
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 22bc12ec374b8bdeb3818ca0a3eb787dd3ce39d8.
REASON: We will remove the MiniTest::Spec from Rails and we need these
methods again
Conflicts:
activesupport/lib/active_support/test_case.rb
|
| |
|
|
|
|
|
|
| |
Tagging every message in tests makes the logs really wide. It's great
for grepping, but annoying to open in an editor or a narrow terminal.
Try out a different approach: spit out a heading before each test.
|
| |
|
| |
|
|
|
|
| |
Check https://github.com/rails/rails/pull/4575#issuecomment-5765575.
|
|
|
|
|
|
|
|
|
| |
This reverts commit 1620df78dff527b4fa3f7b204fa05d1b630aae17, reversing
changes made to 2d000328dfc0d4b297fb4bdcebc9af6c2fb559dc.
Conflicts:
activesupport/CHANGELOG.md
activesupport/lib/active_support/test_case.rb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This only works with mocha v0.13.0 or later.
Note that this also fixes a few subtle bugs present in the current
implementation :-
* Mocha was raising a `MiniTest::Assertion` instead of a
`Mocha::ExpectationError` as intended. The latter is not recognized by
MiniTest as an assertion failure and so it is recorded as a test
*error*, not a test *failure* as it ought to. This leads to
potentially confusing output in the test results.
* Mocha verification should happen as part of the test. The verification
of expectations is equivalent to a set of assertions. These assertions
should happen as *part of* the test so that they have a chance to
cause the test to fail, and not just as part of the teardown. Also if
an assertion fails during the test, then there is no need to verify
expectations, because only the first assertion failure is normally
reported and all subsequent bets are off.
* Expectation verification should be counted as an assertion. Mocha
cannot record each expectation verification as an assertion, because
we weren't passing in an assertion counter to `#mocha_verify`.
|
| |
|
| |
|
|
|
|
| |
rather than exiting the process.
|
| |
|
| |
|
|
|
|
|
| |
AS::TC::ConstantLookup walks the test's name to find the constant it is describing.
This additional lookup logic is needed to better support minitest's spec DSL.
|
| |
|