Skip to content

Instantly share code, notes, and snippets.

@tkhk
Created December 23, 2019 07:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkhk/d63581cb2901d3898c07e65739c1712e to your computer and use it in GitHub Desktop.
Save tkhk/d63581cb2901d3898c07e65739c1712e to your computer and use it in GitHub Desktop.
rails new した時の --skip-test と --skip-system-test の違い

rails new した時の --skip-test と --skip-system-test の違い

--skip-test--skip-system-test をそれぞれつける時とつけない時で比較した

$ diff -ru nooption skiptest
$ diff -ru nooption skipsystemtest

バージョン

$ ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin18]

$ rails -v
Rails 6.0.2.1

--skip-test

プロジェクト直下に test ディレクトリを作らない

Gemfile 内に :test 作らない

-group :test do
-  # Adds support for Capybara system testing and selenium driver
-  gem 'capybara', '>= 2.15'
-  gem 'selenium-webdriver'
-  # Easy installation and use of web drivers to run system tests with browsers
-  gem 'webdrivers'
-end

config/application.rb で明示的に system_tests = nil

-require "rails/test_unit/railtie"
+# require "rails/test_unit/railtie"

...

+    # Don't generate system test files.
+    config.generators.system_tests = nil

--skip-system-test

test ディレクトリに対象のファイル/ディレクトリを作らない

  • test/application_system_test_case.rb
  • test/system

Gemfile 内に :test 作らない

--skip-test と同様

config/application.rb で明示的に system_tests = nil

--skip-test と同様

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment