0
0

More than 3 years have passed since last update.

【アウトプット】 Guardの導入

Posted at

Guardを使うと、ファイルが保存されたと同時にそのファイルのテストが行われるので、いちいちコマンドを打たなくてもよくなる。

導入

GemfileにGemfileの :test グループと :development グループguard-rspec を追加。

Gemfile
group :development, :test do
  gem 'guard-rspec', require: false
end

そして、bundle install。

それから、Guardfileを追加。

$ bundle exec guard init rspec

実行するには、次のコマンドを実行。

$ bundle exec guard

すると、guardが起動し、ファイルの監視が始まる。これを維持しておくと、ソースコードやテストコードを編集した時、RSpecが自動で実行される。

0
0
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
0
0