Module: Drunit

Defined in:
lib/drunit.rb,
lib/drunit/remote_app.rb,
lib/drunit/remote_test.rb

Defined Under Namespace

Modules: ClassMethods Classes: RemoteApp, RemoteError, RemoteTest

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(other) ⇒ Object



41
42
43
# File 'lib/drunit.rb', line 41

def self.included(other)
  other.send(:extend, ClassMethods)
end

Instance Method Details

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



29
30
31
32
33
34
35
# File 'lib/drunit.rb', line 29

def in_app(name, *args, &block)
  file, line, method = caller(2).first.split(":")
  method ||= "unknown_method"
  remote_app_for(name).run(method.gsub(/^in /, "").gsub(/[^a-zA-Z0-9_?!]/, ""), file, line.to_i, *args, &block)
ensure
  remote_app_for(name).last_assertion_count.times{ add_assertion } rescue nil
end

#remote_app_for(name) ⇒ Object



37
38
39
# File 'lib/drunit.rb', line 37

def remote_app_for(name)
  self.class.const_get("RemoteAppFor_#{name}")
end