Class: DataMiner::Step::Test
- Inherits:
-
DataMiner::Step
- Object
- DataMiner::Step
- DataMiner::Step::Test
- Includes:
- RSpec::Expectations, RSpec::Matchers
- Defined in:
- lib/data_miner/step/test.rb
Overview
A step that runs tests and stops the data miner on failures.
Create these by calling test
inside a data_miner
block.
Instance Attribute Summary collapse
-
#after ⇒ Numeric
readonly
After how many rows of the previous step to run the tests.
-
#blk ⇒ Proc
readonly
The block of arbitrary code to be run.
-
#description ⇒ String
(also: #block_description)
readonly
A description of what the block does.
-
#every ⇒ Numeric
readonly
Every how many rows to run tests.
Instance Method Summary collapse
Methods inherited from DataMiner::Step
Instance Attribute Details
#after ⇒ Numeric (readonly)
After how many rows of the previous step to run the tests.
25 26 27 |
# File 'lib/data_miner/step/test.rb', line 25 def after @after end |
#blk ⇒ Proc (readonly)
The block of arbitrary code to be run.
21 22 23 |
# File 'lib/data_miner/step/test.rb', line 21 def blk @blk end |
#description ⇒ String (readonly) Also known as: block_description
A description of what the block does. Doesn’t exist when a single class method is specified using a Symbol.
17 18 19 |
# File 'lib/data_miner/step/test.rb', line 17 def description @description end |
#every ⇒ Numeric (readonly)
Every how many rows to run tests
29 30 31 |
# File 'lib/data_miner/step/test.rb', line 29 def every @every end |
Instance Method Details
#notify(step, count) ⇒ Object
56 57 58 59 60 61 62 63 |
# File 'lib/data_miner/step/test.rb', line 56 def notify(step, count) if count % (after || every) == 0 eval_catching_errors !after # if it's an after, return false, so that we stop getting informed else true end end |
#target?(step) ⇒ Boolean
52 53 54 |
# File 'lib/data_miner/step/test.rb', line 52 def target?(step) !inline? and (step.pos == pos - 1) end |