Skip to content

Commit

Permalink
Reimplement delete environment tests (puma#2710)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobherrington authored and JuanitoFatas committed Sep 9, 2022
1 parent 9b94ed0 commit 7fb3b42
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion test/test_cli.rb
Expand Up @@ -439,4 +439,25 @@ def test_environment_app_env
ENV.delete 'APP_ENV'
ENV.delete 'RAILS_ENV'
end
end

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

0 comments on commit 7fb3b42

Please sign in to comment.