Class: Drunit::RemoteTest::TestCase
- Inherits:
-
Object
- Object
- Drunit::RemoteTest::TestCase
- Includes:
- Test::Unit::Assertions
- Defined in:
- lib/drunit/remote_test.rb
Instance Attribute Summary collapse
-
#assertion_count ⇒ Object
readonly
Returns the value of attribute assertion_count.
Instance Method Summary collapse
- #add_assertion ⇒ Object
-
#initialize(code, source_file, source_line, method_name) ⇒ TestCase
constructor
A new instance of TestCase.
- #run(*args) ⇒ Object
Constructor Details
#initialize(code, source_file, source_line, method_name) ⇒ TestCase
Returns a new instance of TestCase.
18 19 20 21 22 |
# File 'lib/drunit/remote_test.rb', line 18 def initialize(code, source_file, source_line, method_name) @assertion_count = 0 @method_name = method_name instance_eval(code, source_file, source_line) end |
Instance Attribute Details
#assertion_count ⇒ Object (readonly)
Returns the value of attribute assertion_count.
16 17 18 |
# File 'lib/drunit/remote_test.rb', line 16 def assertion_count @assertion_count end |
Instance Method Details
#add_assertion ⇒ Object
24 25 26 |
# File 'lib/drunit/remote_test.rb', line 24 def add_assertion @assertion_count += 1 end |
#run(*args) ⇒ Object
28 29 30 |
# File 'lib/drunit/remote_test.rb', line 28 def run(*args) send(@method_name, *args) end |