Class: TestFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/load/test_factory.rb

Instance Method Summary collapse

Constructor Details

#initializeTestFactory

Returns a new instance of TestFactory.



7
8
# File 'lib/load/test_factory.rb', line 7

def initialize
end

Instance Method Details

#create_test(test_code, target_code, config) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/load/test_factory.rb', line 10

def create_test(test_code, target_code, config)
  test_class = test_code.split(".").first
  test_object = Object::const_get(test_class).new
  test_object.test_code = test_code
  test_object.target_code = target_code
  raise "No parameters for target: :#{target_code}  Test: #{test_code}" unless (config[:params] != nil) && config[:params][target_code.to_sym]
  test_object.params = config[:params][target_code.to_sym]
  return test_object
end