Repository: puma/puma
File: test/helper.rb (Ruby)

Code before:

  # called with one or more params, like skip_on :jruby, :windows
  # optional suffix kwarg is appended to the skip message
  # optional suffix bt should generally not used
  def skip_on(*engs, suffix: '', bt: caller)
    engs.each do |eng|
      skip_msg = case eng
        when :darwin   then "Skipped on darwin#{suffix}"    if RUBY_PLATFORM[/darwin/]
        when :jruby    then "Skipped on JRuby#{suffix}"     if Puma.jruby?
        when :truffleruby then "Skipped on TruffleRuby#{suffix}" if RUBY_ENGINE == "truffleruby"
        when :windows  then "Skipped on Windows#{suffix}"   if Puma.windows?
        when :ci       then "Skipped on ENV['CI']#{suffix}" if ENV["CI"]
        when :no_bundler then "Skipped w/o Bundler#{suffix}"  if !defined?(Bundler)
        else false
      end
      skip skip_msg, bt if skip_msg
    end
  end

  # called with only one param
  def skip_unless(eng, bt: caller)
    skip_msg = case eng
      when :darwin  then "Skip unless darwin"  unless RUBY_PLATFORM[/darwin/]
      when :jruby   then "Skip unless JRuby"   unless Puma.jruby?
      when :windows then "Skip unless Windows" unless Puma.windows?
      when :mri     then "Skip unless MRI" unless Puma.mri?
      else false
    end
    skip skip_msg, bt if skip_msg
  end
end

Minitest::Test.include TestSkips

class Minitest::Test
  def self.run(reporter, options = {}) # :nodoc:
    prove_it!
    super
  end

  def full_name
    "#{self.class.name}##{name}"
  end
end

Minitest.after_run do
  # needed for TestCLI#test_control_clustered
  unless $debugging_hold
    out = $debugging_info.strip
    unless out.empty?
      puts "", " Debugging Info".rjust(75, '-'),

Review comment (suggestion):
```suggestion
      when :mri     then "Skip unless MRI"     unless Puma.mri?
```

Code after:

  # called with one or more params, like skip_on :jruby, :windows
  # optional suffix kwarg is appended to the skip message
  # optional suffix bt should generally not used
  def skip_on(*engs, suffix: '', bt: caller)
    engs.each do |eng|
      skip_msg = case eng
        when :darwin   then "Skipped on darwin#{suffix}"    if RUBY_PLATFORM[/darwin/]
        when :jruby    then "Skipped on JRuby#{suffix}"     if Puma.jruby?
        when :truffleruby then "Skipped on TruffleRuby#{suffix}" if RUBY_ENGINE == "truffleruby"
        when :windows  then "Skipped on Windows#{suffix}"   if Puma.windows?
        when :ci       then "Skipped on ENV['CI']#{suffix}" if ENV["CI"]
        when :no_bundler then "Skipped w/o Bundler#{suffix}"  if !defined?(Bundler)
        else false
      end
      skip skip_msg, bt if skip_msg
    end
  end

  # called with only one param
  def skip_unless(eng, bt: caller)
    skip_msg = case eng
      when :darwin  then "Skip unless darwin"  unless RUBY_PLATFORM[/darwin/]
      when :jruby   then "Skip unless JRuby"   unless Puma.jruby?
      when :windows then "Skip unless Windows" unless Puma.windows?
      when :mri     then "Skip unless MRI"     unless Puma.mri?
      else false
    end
    skip skip_msg, bt if skip_msg
  end
end

Minitest::Test.include TestSkips

class Minitest::Test
  def self.run(reporter, options = {}) # :nodoc:
    prove_it!
    super
  end

  def full_name
    "#{self.class.name}##{name}"
  end
end

Minitest.after_run do
  # needed for TestCLI#test_control_clustered
  unless $debugging_hold
    out = $debugging_info.strip
    unless out.empty?
      puts "", " Debugging Info".rjust(75, '-'),