aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorJonas Baumann <jone@jone.ch>2014-07-16 11:41:25 +0200
committerJonas Baumann <jone@jone.ch>2014-07-16 12:30:46 +0200
commitcbc0c184614b85d8d6b06da93cbdabb8b48fa6a1 (patch)
tree99d7c51f6ceaca435fdd8d8207a13faa598cb981 /guides/source
parent3eca0621602a9f9dbc5e81f007db888d36813ed8 (diff)
downloadrails-cbc0c184614b85d8d6b06da93cbdabb8b48fa6a1.tar.gz
rails-cbc0c184614b85d8d6b06da93cbdabb8b48fa6a1.tar.bz2
rails-cbc0c184614b85d8d6b06da93cbdabb8b48fa6a1.zip
document assert[_not]_empty, assert[_not]_includes, assert[_not]_predicate in testing guide.
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/testing.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/guides/source/testing.md b/guides/source/testing.md
index 561fe2cf70..e780ad2c89 100644
--- a/guides/source/testing.md
+++ b/guides/source/testing.md
@@ -377,8 +377,12 @@ Here's an extract of the assertions you can use with `minitest`, the default tes
| `assert_not_same( expected, actual, [msg] )` | Ensures that `expected.equal?(actual)` is false.|
| `assert_nil( obj, [msg] )` | Ensures that `obj.nil?` is true.|
| `assert_not_nil( obj, [msg] )` | Ensures that `obj.nil?` is false.|
+| `assert_empty( obj, [msg] )` | Ensures that `obj` is `empty?`.|
+| `assert_not_empty( obj, [msg] )` | Ensures that `obj` is not `empty?`.|
| `assert_match( regexp, string, [msg] )` | Ensures that a string matches the regular expression.|
| `assert_no_match( regexp, string, [msg] )` | Ensures that a string doesn't match the regular expression.|
+| `assert_includes( collection, obj, [msg] )` | Ensures that `obj` is in `collection`.|
+| `assert_not_includes( collection, obj, [msg] )` | Ensures that `obj` is not in `collection`.|
| `assert_in_delta( expecting, actual, [delta], [msg] )` | Ensures that the numbers `expected` and `actual` are within `delta` of each other.|
| `assert_not_in_delta( expecting, actual, [delta], [msg] )` | Ensures that the numbers `expected` and `actual` are not within `delta` of each other.|
| `assert_throws( symbol, [msg] ) { block }` | Ensures that the given block throws the symbol.|
@@ -392,6 +396,8 @@ Here's an extract of the assertions you can use with `minitest`, the default tes
| `assert_not_respond_to( obj, symbol, [msg] )` | Ensures that `obj` does not respond to `symbol`.|
| `assert_operator( obj1, operator, [obj2], [msg] )` | Ensures that `obj1.operator(obj2)` is true.|
| `assert_not_operator( obj1, operator, [obj2], [msg] )` | Ensures that `obj1.operator(obj2)` is false.|
+| `assert_predicate ( obj, predicate, [msg] )` | Ensures that `obj.predicate` is true, e.g. `assert_predicate str, :empty?`|
+| `assert_not_predicate ( obj, predicate, [msg] )` | Ensures that `obj.predicate` is false, e.g. `assert_not_predicate str, :empty?`|
| `assert_send( array, [msg] )` | Ensures that executing the method listed in `array[1]` on the object in `array[0]` with the parameters of `array[2 and up]` is true. This one is weird eh?|
| `flunk( [msg] )` | Ensures failure. This is useful to explicitly mark a test that isn't finished yet.|