Permalink
Browse files

Merge pull request #28541 from ota42y/fix/gemfile_generator_fix

ignore system test gems on Gemfile when execute with --skip-test option
  • Loading branch information...
eileencodes committed Mar 27, 2017
2 parents 40ba03a + 72b4265 commit 255ef67d5cd9acb823bce687c85b73e7f15accc8
@@ -413,6 +413,10 @@ def spring_install?
!options[:skip_spring] && !options.dev? && Process.respond_to?(:fork) && !RUBY_PLATFORM.include?("cygwin")
end
def depends_on_system_test?
!(options[:skip_system_test] || options[:skip_test] || options[:api])
end
def depend_on_listen?
!options[:skip_listen] && os_supports_listen_out_of_the_box?
end
@@ -275,7 +275,7 @@ def create_test_files
end
def create_system_test_files
build(:system_test) unless options[:skip_system_test] || options[:skip_test] || options[:api]
build(:system_test) if depends_on_system_test?
end
def create_tmp_files
@@ -32,7 +32,7 @@ end
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
<%- unless options.skip_system_test? || options.api? -%>
<%- if depends_on_system_test? -%>
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 2.13.0'
gem 'selenium-webdriver'
@@ -436,6 +436,30 @@ def test_action_cable_redis_gems
assert_file "Gemfile", /^# gem 'redis'/
end
def test_generator_if_skip_test_is_given
run_generator [destination_root, "--skip-test"]
assert_file "Gemfile" do |content|
assert_no_match(/capybara/, content)
assert_no_match(/selenium-webdriver/, content)
end
end
def test_generator_if_skip_system_test_is_given
run_generator [destination_root, "--skip_system_test"]
assert_file "Gemfile" do |content|
assert_no_match(/capybara/, content)
assert_no_match(/selenium-webdriver/, content)
end
end
def test_generator_if_api_is_given
run_generator [destination_root, "--api"]
assert_file "Gemfile" do |content|
assert_no_match(/capybara/, content)
assert_no_match(/selenium-webdriver/, content)
end
end
def test_inclusion_of_javascript_runtime
run_generator
if defined?(JRUBY_VERSION)

0 comments on commit 255ef67

Please sign in to comment.