LoginSignup
1
1

More than 5 years have passed since last update.

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

Posted at

ファイルを編集したら自動でテストをしたいと思いまして下記の構成で 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 が標準で組み込まれているようで、このような指定が必要っぽいです。
このオプションが指定されると具体的にどう挙動が変わるまでは追っていないので教えて偉い人!

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1