Help us understand the problem. What is going on with this article?

Rails 4 + test-unit + guard で --use-color が出る

More than 3 years have passed since last update.

ファイルを編集したら自動でテストをしたいと思いまして下記の構成で Guard を導入しました。

Ruby 2.2.2
Rails 4.2.1
test-unit 3.1.2
guard 2.0.6

が、なにか不正なオプションであるエラーがでて困りました。

$ bundle exec guard
22:50:19 - INFO - Guard::Test 2.0.6 is running, with Test::Unit 3.1.2!
22:50:19 - INFO - Running all tests

invalid option: --use-color

minitest options:
    -h, --help                       Display this help.
    -s, --seed SEED                  Sets random seed. Also via env. Eg: SEED=n rake
    -v, --verbose                    Verbose. Show progress processing files.
    -n, --name PATTERN               Filter run on /regexp/ or string.

Known extensions: pride
    -p, --pride                      Pride. Show your testing pride!
22:50:23 - INFO - Guard is now watching at '/home/ec2-user/repos/tripnote-api'
[1] guard(main)>

解決策

Guardfile を次のように変更します。

guard :test do
guard :test, spring: true do

Rails 4.1 から spring が標準で組み込まれているようで、このような指定が必要っぽいです。
このオプションが指定されると具体的にどう挙動が変わるまでは追っていないので教えて偉い人!

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした