Exception: Drunit::RemoteError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/drunit.rb,
lib/drunit/remote_test.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(real_exception) ⇒ RemoteError

Returns a new instance of RemoteError.



6
7
8
# File 'lib/drunit/remote_test.rb', line 6

def initialize(real_exception)
  @real_exception = real_exception
end

Class Method Details

.nameObject



3
4
5
# File 'lib/drunit.rb', line 3

def self.name
  @@name
end

Instance Method Details

#classObject



7
8
9
10
11
12
13
14
# File 'lib/drunit.rb', line 7

def class
  if type = look_up_exception
    return type
  else
    @@name = @real_exception.to_s
    super
  end
end

#look_up_exceptionObject



16
17
18
19
20
# File 'lib/drunit.rb', line 16

def look_up_exception
  @real_exception.split("::").inject(Object){|node, part|
    node && node.const_defined?(part) && node.const_get(part)
  }
end