aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/test_case.rb
Commit message (Collapse)AuthorAgeFilesLines
* Remove unneeded `require 'as/deprecation'`claudiob2015-01-041-1/+0
| | | | | Tests should still pass after removing `require 'active_support/deprecation'` from these files since the related deprecations have been removed.
* Change the default test order from `:sorted` to `:random`Rafael Mendonça França2015-01-041-17/+3
|
* Add docs for AS::TestCase::test_orderclaudiob2014-12-181-0/+15
| | | | | | Document `test_order` and `test_order=` from `ActiveSupport::TestCase`. [ci skip]
* edit pass over all warningsXavier Noria2014-10-281-1/+1
| | | | | | | | | | | | | | | This patch uniformizes warning messages. I used the most common style already present in the code base: * Capitalize the first word. * End the message with a full stop. * "Rails 5" instead of "Rails 5.0". * Backticks for method names and inline code. Also, converted a few long strings into the new heredoc convention.
* Define the configuration at Active SupportRafael Mendonça França2014-09-111-10/+7
|
* Default to sorting user's test cases for nowGodfrey Chan2014-09-081-0/+32
| | | | | | | | | | | Goals: 1. Default to :random for newly generated applications 2. Default to :sorted for existing applications with a warning 3. Only show the warning once 4. Only show the warning if the app actually uses AS::TestCase Fixes #16769
* Nobody sucks so nobody should call this awful method nameRafael Mendonça França2014-08-121-0/+4
|
* Remove old setup from AS test caseCarlos Antonio da Silva2014-08-121-5/+0
| | | | | This was added back in Rails 3 on c4a6109286909c394e8c5bfc471a1eb9de245d2b, and is not being used anymore.
* users_dont_suck_but_only_we_suck_and_only_our_tests_are_order_dependent!Akira Matsuda2014-08-121-4/+0
| | | | | Calling ActiveSupport::TestCase.i_suck_and_my_tests_are_order_dependent! in AS::TestCase makes everyone's tests order dependent, which should never be done by the framework.
* Revert "Merge pull request #15305 from tgxworld/remove_unnecessary_require"Santiago Pastorino2014-07-301-0/+2
| | | | | | | This reverts commit f632f79b8dcd144408c66a544984b2ba9cf52f87, reversing changes made to 98c7fe87690ca4de6c46e8f69806e82e3f8af42d. Closes #16343
* Stop requiring mocha automaticallyRafael Mendonça França2014-07-191-5/+0
| | | | | | | | | | | We are planning to remove mocha from our test suite because of performance problems. To make this possible we should stop require mocha on ActionSupport::TestCase. This should not affect applications since users still need to add mocha to Gemfile and this already load mocha. Added FIXME notes to place that still need mocha removal
* Remove unnecessary require of Minitest.Guo Xiang Tan2014-05-241-2/+0
| | | | Minitest has already been required when calling Minitest.autorun.
* Add `#travel` and `#travel_to` to AS::TestCasePrem Sichanugrist2013-11-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* rm minitest monkey patchAaron Patterson2013-11-161-17/+0
|
* Use the method provided by minitest to make tests order dependentGuillermo Iguaran2013-11-091-4/+2
|
* fix typo in comment [ci skip].Yves Senn2013-10-281-1/+1
|
* Remove active_support/testing/pending.rb was deprecated.kennyj2013-06-011-2/+0
|
* Require only minitest.Rafael Mendonça França2013-05-221-1/+1
| | | | | minitest/autorun required minitest/spec and we are avoiding to require it.
* Eliminate minitest warningsSam Ruby2013-05-171-1/+1
| | | | https://github.com/seattlerb/minitest/commit/9a57c520ceac76abfe6105866f8548a94eb357b6#L15R8
* Updates to make rails 4 happy with minitest 5:Ryan Davis2013-05-061-3/+21
| | | | | | | | | | + 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.
* Revert "prevent minitest from printing a --seed run option"Xavier Noria2013-02-241-12/+2
| | | | | | | | | Reason: on a second thought, minitest prints a seed as run option regardless of the test order, and it actually calls srand, so albeit it might be misleading I believe, it is the way it is and should be left that way. This reverts commit c15862ae0cb876d745609170f0f90a9bb9b5e0ae.
* prevent minitest from printing a --seed run optionXavier Noria2013-02-241-2/+12
| | | | See the first FIXME comment in the patch for the rationale.
* Alias refute methods to assert_not and perfer assert_not on testsRafael Mendonça França2012-12-311-1/+10
|
* Inherit from MiniTest::Unit::TestCase instead of MiniTest::SpecRafael Mendonça França2012-12-311-8/+2
|
* Revert "minitest provides "it" and "describe""Rafael Mendonça França2012-12-311-19/+2
| | | | | | | | | | 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
* Replace comments' non-breaking spaces with spacesclaudiob2012-12-041-1/+1
| | | | | | | | | | Sometimes, on Mac OS X, programmers accidentally press Option+Space rather than just Space and don’t see the difference. The problem is that Option+Space writes a non-breaking space (0XA0) rather than a normal space (0x20). This commit removes all the non-breaking spaces inadvertently introduced in the comments of the code.
* Revert "Merge pull request #4575 from carlosantoniodasilva/remove-test-pending"Carlos Antonio da Silva2012-11-181-0/+2
| | | | | | | | | This reverts commit 1620df78dff527b4fa3f7b204fa05d1b630aae17, reversing changes made to 2d000328dfc0d4b297fb4bdcebc9af6c2fb559dc. Conflicts: activesupport/CHANGELOG.md activesupport/lib/active_support/test_case.rb
* Simplify code by taking advantage of latest mocha (v0.13.0).James Mead2012-11-121-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* Make caller attribute in deprecation methods optionalAlexey Gaziev2012-10-301-1/+1
|
* Provide a call stack for deprecation warnings where needed.Nikita Afanasenko2012-10-291-1/+2
| | | | It's sometimes hard to quickly find where deprecated call was performed, especially in case of migrating between Rails versions. So this is an attempt to improve the call stack part of the warning message by providing caller explicitly.
* Remove ActiveRecord::Model consant from AS::TestCaseCarlos Antonio da Silva2012-10-261-1/+1
| | | | Fixing the build.
* ConstantLookup is not needed in every TestCase decendantAndy Lindeman2012-09-261-1/+0
|
* Tests tag the Rails log with the current test class and test caseJeremy Kemper2012-09-261-0/+2
|
* Create ActiveSupport::Testing::ConstantLookupMike Moore2012-09-241-0/+2
| | | | | 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.
* deprecate `describe` without a block.Aaron Patterson2012-07-091-3/+16
| | | | | minitest/spec provides `describe`, so deprecate the rails version and have people use the superclass version
* we still need `describe` as the implementation differs from minitestAaron Patterson2012-07-081-0/+2
|
* minitest provides "it" and "describe"Aaron Patterson2012-07-081-2/+4
| | | | Remove rails implementation of describe, alias "test" to "it"
* minitest is a gem dep, so remove this conditionalAaron Patterson2012-07-081-6/+0
|
* activesupport gem dependencies should reflect the versions we actually useAaron Patterson2012-07-041-0/+1
|
* hook mocha in through m/t before_setup, after_teardown hooksAaron Patterson2012-07-031-1/+3
|
* add documentation to AS::TestCase#assert_nothing_raisedFrancesco Rodriguez2012-06-191-0/+5
|
* MiniTest::Spec shipped with Ruby >= 1.9.3 always responds_to __name__Akira Matsuda2012-06-061-2/+1
|
* Remove ActiveSupport::TestCase#pending, use `skip` insteadCarlos Antonio da Silva2012-01-211-2/+0
|
* spec class names can possibly be nil in mt/s < 2.6.1, so work around thatAaron Patterson2012-01-061-0/+6
|
* register spec subclasses for people who specAaron Patterson2012-01-061-1/+7
|
* require minitest rather than test/unitAaron Patterson2012-01-061-1/+1
|
* backport assert_not_sameAaron Patterson2012-01-061-0/+1
|
* require test/unit and sort test orderAaron Patterson2012-01-061-0/+6
|
* started converting AS::TestCase to minitestAaron Patterson2012-01-061-2/+12
|
* MiniTest condition removedVishnu Atrai2011-12-311-9/+3
|