Class: ActiveSupport::Testing::ProxyTestResult

Inherits:
Object
  • Object
show all
Defined in:
activesupport/lib/active_support/testing/isolation.rb

Instance Method Summary (collapse)

Constructor Details

- (ProxyTestResult) initialize

Returns a new instance of ProxyTestResult



15
16
17
# File 'activesupport/lib/active_support/testing/isolation.rb', line 15

def initialize
  @calls = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

- (Object) method_missing(name, *args)



30
31
32
# File 'activesupport/lib/active_support/testing/isolation.rb', line 30

def method_missing(name, *args)
  @calls << [name, args]
end

Instance Method Details

- (Object) __replay__(result)



24
25
26
27
28
# File 'activesupport/lib/active_support/testing/isolation.rb', line 24

def __replay__(result)
  @calls.each do |name, args|
    result.send(name, *args)
  end
end

- (Object) add_error(e)



19
20
21
22
# File 'activesupport/lib/active_support/testing/isolation.rb', line 19

def add_error(e)
  e = Test::Unit::Error.new(e.test_name, RemoteError.new(e.exception))
  @calls << [:add_error, e]
end