1
1

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.

ci_reporter経由でturnipのテストケースを動かす

1
Posted at

ci_reporter経由で、rspecを実行する場合、.rspecファイルを読み込んでくれないので、明示的にオプションを渡すようなRakeタスクを作成して、その中でturnipを実行する為のオプションを設定する。

下記のコードをRakefileに書く(または、lib/task以下に配置)。

if Rails.env.test?
  require 'rspec/core/rake_task'
  require 'ci/reporter/rake/rspec'

  RSpec::Core::RakeTask.new(ci_rspec:  ["ci:setup:rspec"]) do |t|
    t.pattern = './spec/*'
    t.rspec_opts = ["-r", "turnip/rspec"]
  end
end

上記で作成したRakeタスクを実行。

$ RAILS_ENV=test bundle exec rake ci_rspec
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?