Module: Drunit

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

Defined Under Namespace

Modules: ClassMethods Classes: RemoteApp, RemoteError, RemoteTest

Instance Method Summary collapse

Instance Method Details

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



20
21
22
23
24
25
26
27
28
29
# File 'lib/drunit.rb', line 20

def in_app(name, *args, &block)
  file, line, method = caller_file_and_method_for_block(&block)
  test_case = remote_test_case_for(name)
  test_case.define(block_to_source(method, &block), file, line)
  test_case.run(method, *args)
rescue Exception => e
  rewrite_backtrace(e, method, name) or raise
ensure
  test_case.assertion_count.times{ add_assertion } rescue nil
end