Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment` | Koichi ITO | 2017-07-11 | 1 | -0/+1 |
| | |||||
* | Use frozen-string-literal in ActiveSupport | Kir Shatrov | 2017-07-09 | 1 | -0/+1 |
| | |||||
* | Revert "Merge pull request #29540 from kirs/rubocop-frozen-string" | Matthew Draper | 2017-07-02 | 1 | -1/+0 |
| | | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa. | ||||
* | Enforce frozen string in Rubocop | Kir Shatrov | 2017-07-01 | 1 | -0/+1 |
| | |||||
* | Add missing "not" in the doc for `assert_no_changes` [ci skip] | Ryuta Kamizono | 2017-05-30 | 1 | -1/+1 |
| | |||||
* | use `message` that specified in argument to error message | yuuji.yaginuma | 2016-08-31 | 1 | -1/+1 |
| | |||||
* | use `inspect` for show `from` value | yuuji.yaginuma | 2016-08-29 | 1 | -1/+1 |
| | | | | If `from` is nil, in order to avoid the blank is showed. | ||||
* | Move custom assertion to its proper place | Santosh Wadghule | 2016-08-27 | 1 | -0/+11 |
| | | | | | | | | ActiveSupport::Testing::Assertions. We have a separate module in which have defined Rails' own custom assertions. So it would be good to keep all custom Rails' assertions in one place i.e. in this module. | ||||
* | Introduce `assert_changes` and `assert_no_changes` | Genadi Samokovarov | 2016-07-17 | 1 | -0/+89 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Those are assertions that I really do miss from the standard `ActiveSupport::TestCase`. Think of those as a more general version of `assert_difference` and `assert_no_difference` (those can be implemented by assert_changes, should this change be accepted). Why do we need those? They are useful when you want to check a side-effect of an operation. `assert_difference` do cover a really common case, but we `assert_changes` gives us more control. Having a global error flag? You can test it easily with `assert_changes`. In fact, you can be really specific about the initial state and the terminal one. ```ruby error = Error.new(:bad) assert_changes -> { Error.current }, from: nil, to: error do expected_bad_operation end ``` `assert_changes` follows `assert_difference` and a string can be given for evaluation as well. ```ruby error = Error.new(:bad) assert_changes 'Error.current', from: nil, to: error do expected_bad_operation end ``` Check out the test cases if you wanna see more examples. :beers: | ||||
* | Remove an unused require in ActiveSupport::TestCase | Genadi Samokovarov | 2016-06-13 | 1 | -2/+0 |
| | | | | We used to have `assert_blank` and `assert_presence`. [ci skip] | ||||
* | Fixed wording in Assertion docs, changed ‘Assert’ -> ‘Asserts’ | Ronak Jangir | 2015-10-07 | 1 | -1/+1 |
| | |||||
* | Make `assert_difference` return the result of the yielded block. | Lucas Mazza | 2015-09-24 | 1 | -1/+3 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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? ``` | ||||
* | Remove `assigns` and `assert_template`. | Guo Xiang Tan | 2015-05-30 | 1 | -1/+1 |
| | |||||
* | use keyword arguments in HTTP request methods of assert_difference example ↵ | yuuji.yaginuma | 2015-05-24 | 1 | -9/+9 |
| | | | | [ci skip] | ||||
* | Pass symbol as an argument instead of a block | Erik Michaels-Ober | 2014-11-29 | 1 | -1/+1 |
| | |||||
* | [ci skip] Correct output of #assert_not | Akshay Vishnoi | 2014-06-12 | 1 | -1/+1 |
| | |||||
* | remove deprecated `assert_present` and `assert_blank`. | Yves Senn | 2013-07-01 | 1 | -30/+0 |
| | |||||
* | deprecate `assert_blank` and `assert_present`. | Yves Senn | 2013-01-05 | 1 | -0/+2 |
| | | | | | They don't add any benefits over `assert object.blank?` and `assert object.present?` | ||||
* | Introduce assert_not to replace 'assert !foo' | Jeremy Kemper | 2012-12-28 | 1 | -0/+16 |
| | |||||
* | update AS/notifications and AS/testing docs [ci skip] | Francesco Rodriguez | 2012-09-14 | 1 | -3/+5 |
| | |||||
* | fixes a few mistakes in api docs [ci skip] | Vijay Dev | 2012-06-22 | 1 | -1/+1 |
| | |||||
* | update AS::Testing::Assertions docs | Francesco Rodriguez | 2012-06-19 | 1 | -21/+32 |
| | |||||
* | fix typo [ci skip] | Francesco Rodriguez | 2012-06-19 | 1 | -2/+2 |
| | |||||
* | Remove Array.wrap calls in ActiveSupport | Rafael Mendonça França | 2012-01-06 | 1 | -2/+1 |
| | |||||
* | Fix syntax error in rdocs. | Semyon Perepelitsa | 2011-12-20 | 1 | -1/+1 |
| | | | Ruby assumes curly braces in foo {} as a block, for hash we need to put parentheses or omit braces | ||||
* | fixing assert_difference issues on ruby 1.8 | Aaron Patterson | 2011-08-04 | 1 | -6/+7 |
| | |||||
* | make assert_difference error message not suck | Aaron Patterson | 2011-08-03 | 1 | -5/+6 |
| | |||||
* | correct error message for failed creation | Ray Baxter | 2011-06-26 | 1 | -1/+1 |
| | |||||
* | convert strings to lambdas so we can use a consistent interface to the ↵ | Aaron Patterson | 2011-05-01 | 1 | -5/+5 |
| | | | | objects in the collection | ||||
* | assert_difference can take a callable piece of code rather than just evaling ↵ | Aaron Patterson | 2011-05-01 | 1 | -4/+15 |
| | | | | a string | ||||
* | code gardening: we have assert_(nil|blank|present), more concise, with ↵ | Xavier Noria | 2010-08-17 | 1 | -4/+6 |
| | | | | better default failure messages - let's use them | ||||
* | Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵ | Santiago Pastorino | 2010-08-14 | 1 | -2/+2 |
| | | | | 's/[ \t]*$//' -i {} \;) | ||||
* | adds missing require for blank? and present? | Xavier Noria | 2010-03-31 | 1 | -0/+1 |
| | |||||
* | New assertion: assert_present [#4299 state:committed] | Juanjo Bazan | 2010-03-30 | 1 | -0/+7 |
| | | | | Signed-off-by: Xavier Noria <fxn@hashref.com> | ||||
* | new assertion: assert_blank | Juanjo Bazan | 2010-03-30 | 1 | -0/+7 |
| | | | | Signed-off-by: Xavier Noria <fxn@hashref.com> | ||||
* | Fix dependencies revealed by testing in isolation | Jeremy Kemper | 2009-04-22 | 1 | -0/+2 |
| | |||||
* | Oops, don't yield per expression | Jeremy Kemper | 2009-02-06 | 1 | -10/+9 |
| | |||||
* | Include failed difference expression in assert message | Jeremy Kemper | 2009-02-06 | 1 | -8/+10 |
| | |||||
* | Work around enumerable string deprecation warnings | Jeremy Kemper | 2009-02-06 | 1 | -6/+9 |
| | |||||
* | Rework testing extensions to reflect the recent miniunit upheaval | Jeremy Kemper | 2008-11-07 | 1 | -1/+1 |
| | |||||
* | Remove direct TestCase mixins. Add miniunit compatibility. | Jeremy Kemper | 2008-11-07 | 1 | -0/+61 |