Class: Test::Unit::TestResultAttributesSupport

Inherits:
Object
  • Object
show all
Defined in:
lib/test-unit-ext/attributes.rb

Instance Method Summary collapse

Constructor Details

#initialize(result, test) ⇒ TestResultAttributesSupport

Returns a new instance of TestResultAttributesSupport.



73
74
75
76
# File 'lib/test-unit-ext/attributes.rb', line 73

def initialize(result, test)
  @result = result
  @test = test
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



88
89
90
# File 'lib/test-unit-ext/attributes.rb', line 88

def method_missing(name, *args, &block)
  @result.send(name, *args, &block)
end

Instance Method Details

#add_error(error) ⇒ Object



83
84
85
86
# File 'lib/test-unit-ext/attributes.rb', line 83

def add_error(error)
  error.attributes = @test.attributes
  method_missing(:add_error, error)
end

#add_failure(failure) ⇒ Object



78
79
80
81
# File 'lib/test-unit-ext/attributes.rb', line 78

def add_failure(failure)
  failure.attributes = @test.attributes
  method_missing(:add_failure, failure)
end