0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Guardを使ってrspecテスト自動化

Posted at

rspecのテストを自動化する。

rails内で作業ファイルを保存した際に自動でテストが実行されるようにする。

まず下記のgemを追加。

group :development, :test do

  gem 'rspec-rails'
  gem 'guard'
  gem 'guard-rspec'

その後bundle installして

rails g rspec:install

これでrspecの準備は完了。

guardを導入して自動化

下記のコマンドでGuardfileを作成する。

bundle exec guard init

そしてbundle exec guardで実装完了。

...のはずが、cannot load fileエラーが発生した。

原因はディレクトリに日本語が入ってしまっていたから。
なのでディレクトリの名前を変えてbundle exec guardで解決。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?