Class: Test::Unit::StatusLineOutput

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

Overview

:nodoc: all

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



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

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



786
787
788
# File 'lib/test/unit.rb', line 786

def runner
  @runner
end

Instance Method Details



791
792
793
794
795
796
797
798
799
800
801
802
803
804
# File 'lib/test/unit.rb', line 791

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



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

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

#respond_to_missing?(*a) ⇒ Boolean

Returns:

  • (Boolean)


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

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