Skip to content

Commit

Permalink
Add integration test to help prevent JSON loading regressions (#2436)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjlarose committed Oct 20, 2020
1 parent 0ff1a50 commit 3f0913a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/config/prune_bundler_print_json_defined.rb
@@ -0,0 +1,4 @@
prune_bundler true
before_fork do
puts "defined?(JSON): #{defined?(JSON).inspect}"
end
7 changes: 7 additions & 0 deletions test/test_integration_cluster.rb
Expand Up @@ -261,6 +261,13 @@ def test_load_path_does_not_include_nio4r
end
end

def test_json_gem_not_required_in_master_process
cli_server "-w #{workers} -C test/config/prune_bundler_print_json_defined.rb test/rackup/hello.ru"

line = @server.gets
assert_match(/defined\?\(JSON\): nil/, line)
end

private

def worker_timeout(timeout, iterations, config)
Expand Down

0 comments on commit 3f0913a

Please sign in to comment.