Class: Test::Unit::StatusLineOutput

Inherits:
Struct
  • Object
show all
Defined in:
lib/test/unit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*a, &b) ⇒ Object



783
# File 'lib/test/unit.rb', line 783

def method_missing(*a, &b) $stdout.__send__(*a, &b) end

Instance Attribute Details

#runnerObject

Returns the value of attribute runner

Returns:

  • (Object)

    the current value of runner



780
781
782
# File 'lib/test/unit.rb', line 780

def runner
  @runner
end

Instance Method Details



785
786
787
788
789
790
791
792
793
794
795
796
797
798
# File 'lib/test/unit.rb', line 785

def print(s)
  case s
  when /\A(.*\#.*) = \z/
    runner.new_test($1)
  when /\A(.* s) = \z/
    runner.add_status(" = "+$1.chomp)
  when /\A\.+\z/
    runner.succeed
  when /\A[EFS]\z/
    runner.failed(s)
  else
    $stdout.print(s)
  end
end

#puts(*a) ⇒ Object



781
# File 'lib/test/unit.rb', line 781

def puts(*a) $stdout.puts(*a) unless a.empty? end

#respond_to_missing?(*a) ⇒ Boolean

Returns:

  • (Boolean)


782
# File 'lib/test/unit.rb', line 782

def respond_to_missing?(*a) $stdout.respond_to?(*a) end