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.
94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/remi/cucumber/business_rules.rb', line 94 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.
113 114 115 |
# File 'lib/remi/cucumber/business_rules.rb', line 113 def examples @examples end |
#filestore ⇒ Object (readonly)
Returns the value of attribute filestore.
114 115 116 |
# File 'lib/remi/cucumber/business_rules.rb', line 114 def filestore @filestore end |
#job ⇒ Object (readonly)
Returns the value of attribute job.
108 109 110 |
# File 'lib/remi/cucumber/business_rules.rb', line 108 def job @job end |
#job_sources ⇒ Object (readonly)
Returns the value of attribute job_sources.
109 110 111 |
# File 'lib/remi/cucumber/business_rules.rb', line 109 def job_sources @job_sources end |
#job_targets ⇒ Object (readonly)
Returns the value of attribute job_targets.
110 111 112 |
# File 'lib/remi/cucumber/business_rules.rb', line 110 def job_targets @job_targets end |
#sources ⇒ Object (readonly)
Returns the value of attribute sources.
111 112 113 |
# File 'lib/remi/cucumber/business_rules.rb', line 111 def sources @sources end |
#targets ⇒ Object (readonly)
Returns the value of attribute targets.
112 113 114 |
# File 'lib/remi/cucumber/business_rules.rb', line 112 def targets @targets end |
Instance Method Details
#add_example(example_name, example_table) ⇒ Object
148 149 150 |
# File 'lib/remi/cucumber/business_rules.rb', line 148 def add_example(example_name, example_table) @examples.add_example(example_name, example_table) end |
#add_job_source(name) ⇒ Object
116 117 118 119 120 |
# File 'lib/remi/cucumber/business_rules.rb', line 116 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
122 123 124 125 |
# File 'lib/remi/cucumber/business_rules.rb', line 122 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
131 132 133 |
# File 'lib/remi/cucumber/business_rules.rb', line 131 def add_source(name) @sources.add_subject(name, @job.send(name.symbolize)) end |
#add_target(name) ⇒ Object
139 140 141 |
# File 'lib/remi/cucumber/business_rules.rb', line 139 def add_target(name) @targets.add_subject(name, @job.send(name.symbolize)) end |
#run_transforms ⇒ Object
152 153 154 |
# File 'lib/remi/cucumber/business_rules.rb', line 152 def run_transforms @job.run_all_transforms end |
#set_job_parameter(name, value) ⇒ Object
127 128 129 |
# File 'lib/remi/cucumber/business_rules.rb', line 127 def set_job_parameter(name, value) @job.params[name.to_sym] = value end |
#source ⇒ Object
135 136 137 |
# File 'lib/remi/cucumber/business_rules.rb', line 135 def source @sources.only end |
#target ⇒ Object
143 144 145 |
# File 'lib/remi/cucumber/business_rules.rb', line 143 def target @targets.only end |