Skip to content

Commit

Permalink
Reimplement delete environment tests (#2710)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobherrington committed Sep 22, 2021
1 parent e3acca8 commit e2815b6
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 e2815b6

Please sign in to comment.