aboutsummaryrefslogblamecommitdiffstats
path: root/actionpack/lib/action_dispatch/system_testing/server.rb
blob: 32aa6a4dc4095b07bb7205d092f8190315f28d62 (plain) (tree)
1
2
3
4
5
6
7

                             




                           





                                   
             



             
                 




                      
                                                                      
           



                                             


       
# frozen_string_literal: true

require "rack/handler/puma"

module ActionDispatch
  module SystemTesting
    class Server # :nodoc:
      class << self
        attr_accessor :silence_puma
      end

      self.silence_puma = false

      def run
        setup
      end

      private
        def setup
          set_server
          set_port
        end

        def set_server
          Capybara.server = :puma, { Silent: self.class.silence_puma }
        end

        def set_port
          Capybara.always_include_port = true
        end
    end
  end
end