mirror of https://github.com/rails/rails
Rewrite test_spring_no_fork
The previous version of the test was fragile, and it skipped running on JRuby even though its purpose is to test environments like JRuby.
This commit is contained in:
parent
20e8314273
commit
b653778169
|
@ -880,12 +880,13 @@ class AppGeneratorTest < Rails::Generators::TestCase
|
|||
end
|
||||
|
||||
def test_spring_no_fork
|
||||
jruby_skip "spring doesn't run on JRuby"
|
||||
assert_called_with(Process, :respond_to?, [[:fork], [:fork], [:fork], [:fork]], returns: false) do
|
||||
respond_to = Process.method(:respond_to?)
|
||||
respond_to_stub = -> (name) { name != :fork && respond_to[name] }
|
||||
Process.stub(:respond_to?, respond_to_stub) do
|
||||
run_generator
|
||||
|
||||
assert_no_gem "spring"
|
||||
end
|
||||
|
||||
assert_no_gem "spring"
|
||||
end
|
||||
|
||||
def test_skip_spring
|
||||
|
|
Loading…
Reference in New Issue