Class: Remi::BusinessRules::Tester
- Inherits:
-
Object
- Object
- Remi::BusinessRules::Tester
- Defined in:
- lib/remi/cucumber/business_rules.rb
Instance Attribute Summary collapse
-
#examples ⇒ Object
readonly
Returns the value of attribute examples.
-
#filestore ⇒ Object
readonly
Returns the value of attribute filestore.
-
#job ⇒ Object
readonly
Returns the value of attribute job.
-
#job_sources ⇒ Object
readonly
Returns the value of attribute job_sources.
-
#job_targets ⇒ Object
readonly
Returns the value of attribute job_targets.
-
#sources ⇒ Object
readonly
Returns the value of attribute sources.
-
#targets ⇒ Object
readonly
Returns the value of attribute targets.
Instance Method Summary collapse
- #add_example(example_name, example_table) ⇒ Object
- #add_job_source(name) ⇒ Object
- #add_job_target(name) ⇒ Object
- #add_source(name) ⇒ Object
- #add_target(name) ⇒ Object
-
#initialize(job_name) ⇒ Tester
constructor
A new instance of Tester.
- #run_transforms ⇒ Object
- #set_job_parameter(name, value) ⇒ Object
- #source ⇒ Object
- #target ⇒ Object
Constructor Details
#initialize(job_name) ⇒ Tester
Returns a new instance of Tester.
91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/remi/cucumber/business_rules.rb', line 91 def initialize(job_name) job_class_name = "#{job_name.gsub(/\s/,'')}Job" @job = Object.const_get(job_class_name).new @job_sources = DataSubjectCollection.new @job_targets = DataSubjectCollection.new @sources = DataSubjectCollection.new @targets = DataSubjectCollection.new @examples = DataExampleCollection.new @filestore = Filestore.new end |
Instance Attribute Details
#examples ⇒ Object (readonly)
Returns the value of attribute examples.
110 111 112 |
# File 'lib/remi/cucumber/business_rules.rb', line 110 def examples @examples end |
#filestore ⇒ Object (readonly)
Returns the value of attribute filestore.
111 112 113 |
# File 'lib/remi/cucumber/business_rules.rb', line 111 def filestore @filestore end |
#job ⇒ Object (readonly)
Returns the value of attribute job.
105 106 107 |
# File 'lib/remi/cucumber/business_rules.rb', line 105 def job @job end |
#job_sources ⇒ Object (readonly)
Returns the value of attribute job_sources.
106 107 108 |
# File 'lib/remi/cucumber/business_rules.rb', line 106 def job_sources @job_sources end |
#job_targets ⇒ Object (readonly)
Returns the value of attribute job_targets.
107 108 109 |
# File 'lib/remi/cucumber/business_rules.rb', line 107 def job_targets @job_targets end |
#sources ⇒ Object (readonly)
Returns the value of attribute sources.
108 109 110 |
# File 'lib/remi/cucumber/business_rules.rb', line 108 def sources @sources end |
#targets ⇒ Object (readonly)
Returns the value of attribute targets.
109 110 111 |
# File 'lib/remi/cucumber/business_rules.rb', line 109 def targets @targets end |
Instance Method Details
#add_example(example_name, example_table) ⇒ Object
145 146 147 |
# File 'lib/remi/cucumber/business_rules.rb', line 145 def add_example(example_name, example_table) @examples.add_example(example_name, example_table) end |
#add_job_source(name) ⇒ Object
113 114 115 116 117 |
# File 'lib/remi/cucumber/business_rules.rb', line 113 def add_job_source(name) raise "Unknown source #{name} for job" unless @job.methods.include? name.symbolize @job_sources.add_subject(name, @job.send(name.symbolize)) @job.send(name.symbolize).empty_stub_df end |
#add_job_target(name) ⇒ Object
119 120 121 122 |
# File 'lib/remi/cucumber/business_rules.rb', line 119 def add_job_target(name) raise "Unknown target #{name} for job" unless @job.methods.include? name.symbolize @job_targets.add_subject(name, @job.send(name.symbolize)) end |
#add_source(name) ⇒ Object
128 129 130 |
# File 'lib/remi/cucumber/business_rules.rb', line 128 def add_source(name) @sources.add_subject(name, @job.send(name.symbolize)) end |
#add_target(name) ⇒ Object
136 137 138 |
# File 'lib/remi/cucumber/business_rules.rb', line 136 def add_target(name) @targets.add_subject(name, @job.send(name.symbolize)) end |
#run_transforms ⇒ Object
149 150 151 |
# File 'lib/remi/cucumber/business_rules.rb', line 149 def run_transforms @job.run_all_transforms end |
#set_job_parameter(name, value) ⇒ Object
124 125 126 |
# File 'lib/remi/cucumber/business_rules.rb', line 124 def set_job_parameter(name, value) @job.params[name.to_sym] = value end |
#source ⇒ Object
132 133 134 |
# File 'lib/remi/cucumber/business_rules.rb', line 132 def source @sources.only end |
#target ⇒ Object
140 141 142 |
# File 'lib/remi/cucumber/business_rules.rb', line 140 def target @targets.only end |