Class: Testgen::TestData
- Inherits:
-
Object
- Object
- Testgen::TestData
- Defined in:
- lib/testgen/cli.rb
Overview
class : TestData
Objects of type TestData hold the data for a single test
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
The test data (a hash).
-
#name ⇒ Object
The name of the test.
-
#result ⇒ Object
The expected result.
Instance Method Summary collapse
-
#add_argument(name, value) ⇒ Object
add_argument( name, value ).
-
#initialize ⇒ TestData
constructor
initialize().
Constructor Details
#initialize ⇒ TestData
initialize()
Constructs the TestData object
36 37 38 39 40 |
# File 'lib/testgen/cli.rb', line 36 def initialize() @name = "" @result = "" @arguments = {} end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
The test data (a hash)
43 44 45 |
# File 'lib/testgen/cli.rb', line 43 def arguments @arguments end |
#name ⇒ Object
The name of the test
41 42 43 |
# File 'lib/testgen/cli.rb', line 41 def name @name end |
#result ⇒ Object
The expected result
42 43 44 |
# File 'lib/testgen/cli.rb', line 42 def result @result end |
Instance Method Details
#add_argument(name, value) ⇒ Object
add_argument( name, value )
name - The name of the argument value - The test data value
This adds data to the test
50 51 52 |
# File 'lib/testgen/cli.rb', line 50 def add_argument( name, value ) @arguments[ name ] = value end |