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.
114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/remi/cucumber/business_rules.rb', line 114 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.
133 134 135 |
# File 'lib/remi/cucumber/business_rules.rb', line 133 def examples @examples end |
#filestore ⇒ Object (readonly)
Returns the value of attribute filestore.
134 135 136 |
# File 'lib/remi/cucumber/business_rules.rb', line 134 def filestore @filestore end |
#job ⇒ Object (readonly)
Returns the value of attribute job.
128 129 130 |
# File 'lib/remi/cucumber/business_rules.rb', line 128 def job @job end |
#job_sources ⇒ Object (readonly)
Returns the value of attribute job_sources.
129 130 131 |
# File 'lib/remi/cucumber/business_rules.rb', line 129 def job_sources @job_sources end |
#job_targets ⇒ Object (readonly)
Returns the value of attribute job_targets.
130 131 132 |
# File 'lib/remi/cucumber/business_rules.rb', line 130 def job_targets @job_targets end |
#sources ⇒ Object (readonly)
Returns the value of attribute sources.
131 132 133 |
# File 'lib/remi/cucumber/business_rules.rb', line 131 def sources @sources end |
#targets ⇒ Object (readonly)
Returns the value of attribute targets.
132 133 134 |
# File 'lib/remi/cucumber/business_rules.rb', line 132 def targets @targets end |
Instance Method Details
#add_example(example_name, example_table) ⇒ Object
168 169 170 |
# File 'lib/remi/cucumber/business_rules.rb', line 168 def add_example(example_name, example_table) @examples.add_example(example_name, example_table) end |
#add_job_source(name) ⇒ Object
136 137 138 139 140 |
# File 'lib/remi/cucumber/business_rules.rb', line 136 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
142 143 144 145 |
# File 'lib/remi/cucumber/business_rules.rb', line 142 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
151 152 153 |
# File 'lib/remi/cucumber/business_rules.rb', line 151 def add_source(name) @sources.add_subject(name, @job.send(name.symbolize)) end |
#add_target(name) ⇒ Object
159 160 161 |
# File 'lib/remi/cucumber/business_rules.rb', line 159 def add_target(name) @targets.add_subject(name, @job.send(name.symbolize)) end |
#run_transforms ⇒ Object
172 173 174 |
# File 'lib/remi/cucumber/business_rules.rb', line 172 def run_transforms @job.run_all_transforms end |
#set_job_parameter(name, value) ⇒ Object
147 148 149 |
# File 'lib/remi/cucumber/business_rules.rb', line 147 def set_job_parameter(name, value) @job.params[name.to_sym] = value end |
#source ⇒ Object
155 156 157 |
# File 'lib/remi/cucumber/business_rules.rb', line 155 def source @sources.only end |
#target ⇒ Object
163 164 165 |
# File 'lib/remi/cucumber/business_rules.rb', line 163 def target @targets.only end |