Class: Testgen::TestData

Inherits:
Object
  • Object
show all
Defined in:
lib/testgen/cli.rb

Overview

class : TestData

Objects of type TestData hold the data for a single test

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTestData

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

#argumentsObject (readonly)

The test data (a hash)



43
44
45
# File 'lib/testgen/cli.rb', line 43

def arguments
  @arguments
end

#nameObject

The name of the test



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

def name
  @name
end

#resultObject

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