Class: TestHarness

Inherits:
Object
  • Object
show all
Defined in:
lib/given.rb,
lib/ui_view.rb,
lib/ui_driver.rb,
lib/ui_helper.rb,
lib/utilities.rb,
lib/form_struct.rb,
lib/test_helper.rb,
lib/mental_model.rb,
lib/test_harness.rb,
lib/ui_component.rb,
lib/configuration.rb,
lib/ui_component_helper.rb

Defined Under Namespace

Modules: TestHelper, UIComponentHelper, Utilities Classes: Configuration, FormStruct, Given, MentalModel, UIComponent, UIDriver, UIHelper, UIView

Class Method Summary collapse

Class Method Details

.autoloadObject



10
11
12
13
14
# File 'lib/test_harness.rb', line 10

def autoload
  TestHarness::Given.autoload
  TestHarness::UIView.autoload
  TestHarness::UIDriver.autoload
end

.autoload_pathObject



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

def autoload_path
  @path ||= configuration.autoload_path || 'test_harness'
end

.configurationObject



6
7
8
# File 'lib/test_harness.rb', line 6

def configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



16
17
18
# File 'lib/test_harness.rb', line 16

def configure(&block)
  yield configuration
end

.givenObject



25
26
27
# File 'lib/test_harness.rb', line 25

def given
  @given ||= TestHarness::Given.new
end

.mmObject



37
38
39
# File 'lib/test_harness.rb', line 37

def mm
  @mm ||= TestHarness::MentalModel.new
end

.namespaceObject



45
46
47
# File 'lib/test_harness.rb', line 45

def namespace
  @namespace ||= configuration.namespace || 'TestHarness'
end

.register_instance_option(scope, option_name, instance) ⇒ Object



53
54
55
56
57
58
59
# File 'lib/test_harness.rb', line 53

def register_instance_option(scope, option_name, instance)
  return if registered_components.any? { |c| c.is_a? instance.class }
  registered_components << instance
  scope.send(:define_method, option_name.gsub('/', '_')) do
    instance
  end
end

.registered_componentsObject



49
50
51
# File 'lib/test_harness.rb', line 49

def registered_components
  @components ||= []
end

.resetObject



20
21
22
23
# File 'lib/test_harness.rb', line 20

def reset
  @mm = nil
  registered_components.each(&:reset)
end

.uidObject



33
34
35
# File 'lib/test_harness.rb', line 33

def uid
  @uid ||= TestHarness::UIDriver.new
end

.uivObject



29
30
31
# File 'lib/test_harness.rb', line 29

def uiv
  @uiv ||= TestHarness::UIView.new
end