diff --git a/test/test_cli.rb b/test/test_cli.rb index c8726ea3c5..4710b7ce60 100644 --- a/test/test_cli.rb +++ b/test/test_cli.rb @@ -439,4 +439,25 @@ def test_environment_app_env ENV.delete 'APP_ENV' ENV.delete 'RAILS_ENV' end -end \ No newline at end of file + + def test_environment_rack_env + ENV['RACK_ENV'] = @environment + + cli = Puma::CLI.new [] + cli.send(:setup_options) + + assert_equal @environment, cli.instance_variable_get(:@conf).environment.call + end + + def test_environment_rails_env + ENV.delete 'RACK_ENV' + ENV['RAILS_ENV'] = @environment + + cli = Puma::CLI.new [] + cli.send(:setup_options) + + assert_equal @environment, cli.instance_variable_get(:@conf).environment.call + ensure + ENV.delete 'RAILS_ENV' + end +end