Class: ActiveSupport::Testing::ProxyTestResult

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

Instance Method Summary collapse

Constructor Details

#initialize(calls = []) ⇒ ProxyTestResult

Returns a new instance of ProxyTestResult


17
18
19
# File 'activesupport/lib/active_support/testing/isolation.rb', line 17

def initialize(calls = [])
  @calls = calls
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object


40
41
42
# File 'activesupport/lib/active_support/testing/isolation.rb', line 40

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

Instance Method Details

#__replay__(result) ⇒ Object


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

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

#add_error(e) ⇒ Object


21
22
23
24
# File 'activesupport/lib/active_support/testing/isolation.rb', line 21

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

#info_signalObject


44
45
46
# File 'activesupport/lib/active_support/testing/isolation.rb', line 44

def info_signal
  Signal.list['INFO']
end

#marshal_dumpObject


32
33
34
# File 'activesupport/lib/active_support/testing/isolation.rb', line 32

def marshal_dump
  @calls
end

#marshal_load(calls) ⇒ Object


36
37
38
# File 'activesupport/lib/active_support/testing/isolation.rb', line 36

def marshal_load(calls)
  initialize(calls)
end