aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikac.hu>2013-02-01 17:21:09 -0500
committerPrem Sichanugrist <s@sikac.hu>2013-03-09 16:03:55 -0500
commit176b57c5430ddae7668114994c35b3293b0a05a5 (patch)
tree6128b0b1c415c12e54eeaf5808707d27d926093c /guides
parent9f75f7735ac387e9d44db511c5cef7b7453f6bba (diff)
downloadrails-176b57c5430ddae7668114994c35b3293b0a05a5.tar.gz
rails-176b57c5430ddae7668114994c35b3293b0a05a5.tar.bz2
rails-176b57c5430ddae7668114994c35b3293b0a05a5.zip
Add support for MiniTest flags in TestRunner
Any flags that got set will be passed through to MiniTest::Unit.runner, such as `-n`, `-s-, and `-v`.
Diffstat (limited to 'guides')
-rw-r--r--guides/source/testing.md25
1 files changed, 5 insertions, 20 deletions
diff --git a/guides/source/testing.md b/guides/source/testing.md
index ccb925f309..12f7260c62 100644
--- a/guides/source/testing.md
+++ b/guides/source/testing.md
@@ -38,7 +38,6 @@ Rails creates a `test` folder for you as soon as you create a Rails project usin
```bash
$ ls -F test
-
controllers/ helpers/ mailers/ test_helper.rb
fixtures/ integration/ models/
```
@@ -235,13 +234,10 @@ Finished tests in 0.009262s, 107.9680 tests/s, 107.9680 assertions/s.
1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
```
-You can also run a particular test method from the test case by running the test using Ruby and use the `-n` switch with the `test method name`.
+You can also run a particular test method from the test case by running the test and use the `-n` switch with the `test method name`.
```bash
-Run options: -n test_the_truth --seed 23064
-
-# Running tests:
-
+$ rails test test/models/post_test.rb -n test_the_truth
.
Finished tests in 0.009064s, 110.3266 tests/s, 110.3266 assertions/s.
@@ -265,10 +261,7 @@ end
Let us run this newly added test.
```bash
-Run options: -n test_should_not_save_post_without_title --seed 38984
-
-# Running tests:
-
+$ rails test test/models/post_test.rb -n test_should_not_save_post_without_title
F
Finished tests in 0.044632s, 22.4054 tests/s, 22.4054 assertions/s.
@@ -308,11 +301,7 @@ end
Now the test should pass. Let us verify by running the test again:
```bash
-$ ruby -Itest test/models/post_test.rb -n test_should_not_save_post_without_title
-Run options: -n test_should_not_save_post_without_title --seed 62114
-
-# Running tests:
-
+$ rails test test/models/post_test.rb -n test_should_not_save_post_without_title
.
Finished tests in 0.047721s, 20.9551 tests/s, 20.9551 assertions/s.
@@ -337,11 +326,7 @@ end
Now you can see even more output in the console from running the tests:
```bash
-$ ruby -Itest test/models/post_test.rb -n test_should_report_error
-Run options: -n test_should_report_error --seed 22995
-
-# Running tests:
-
+$ rails test test/models/post_test.rb -n test_should_report_error
E
Finished tests in 0.030974s, 32.2851 tests/s, 0.0000 assertions/s.