Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update assertion methods in testing guide #16187

Merged
merged 2 commits into from Jul 16, 2014

Conversation

@jone
Copy link
Contributor

commented Jul 16, 2014

Adds documentation for these assertion methods to the testing guide:

  • assert_empty
  • assert_not_empty
  • assert_includes
  • assert_not_includes
  • assert_predicate
  • assert_not_predicate

I've also linked the minitest assertions documentation page for the full list of minitest assertions, as well as the minitest github repo.

/cc @senny

@senny

This comment has been minimized.

Copy link
Member

commented Jul 16, 2014

Can we also incorporate assert_predicate?

@senny

View changes

guides/source/testing.md Outdated
@@ -365,7 +365,7 @@ Ideally, you would like to include a test for everything which could possibly br
By now you've caught a glimpse of some of the assertions that are available. Assertions are the worker bees of testing. They are the ones that actually perform the checks to ensure that things are going as planned.

There are a bunch of different types of assertions you can use.
Here's an extract of the assertions you can use with `minitest`, the default testing library used by Rails. The `[msg]` parameter is an optional string message you can specify to make your test failure messages clearer. It's not required.
Here's an extract of the assertions you can use with [minitest](http://docs.seattlerb.org/minitest/Minitest/Assertions.html), the default testing library used by Rails. The `[msg]` parameter is an optional string message you can specify to make your test failure messages clearer. It's not required.

This comment has been minimized.

Copy link
@senny

senny Jul 16, 2014

Member

can you wrap this to 80 chars?

@jone

This comment has been minimized.

Copy link
Contributor Author

commented Jul 16, 2014

@senn updated: added assert_predicate and updated link / wrapped paragraph.

senny added a commit that referenced this pull request Jul 16, 2014
Merge pull request #16187 from jone/testing-guide-assertions
Update assertion methods in testing guide [ci skip]

@senny senny merged commit 7876ac8 into rails:master Jul 16, 2014

1 check was pending

continuous-integration/travis-ci The Travis CI build is in progress
Details
@senny

This comment has been minimized.

Copy link
Member

commented Jul 16, 2014

Thank you 💛

Forgot to mention but we do add [ci skip] for doc patches to make Travis 🏃 less.

@jone jone deleted the jone:testing-guide-assertions branch Jul 19, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.