File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,10 @@ def setup_options
185185 user_config . restart_command cmd
186186 end
187187
188+ o . on "-s" , "--silent" , "Do not log prompt messages other than errors" do
189+ @events = Events . new NullIO . new , $stderr
190+ end
191+
188192 o . on "-S" , "--state PATH" , "Where to store the state details" do |arg |
189193 user_config . state_path arg
190194 end
Original file line number Diff line number Diff line change @@ -475,4 +475,15 @@ def test_environment_rails_env
475475 ensure
476476 ENV . delete 'RAILS_ENV'
477477 end
478+
479+ def test_silent
480+ cli = Puma ::CLI . new [ '--silent' ]
481+ cli . send ( :setup_options )
482+
483+ events = cli . instance_variable_get ( :@events )
484+
485+ assert_equal events . class , Puma ::Events . null . class
486+ assert_equal events . stdout . class , Puma ::NullIO
487+ assert_equal events . stderr , $stderr
488+ end
478489end
You can’t perform that action at this time.
0 commit comments