Class: Uttk::Strategies::Block
- Includes:
- Concrete
- Defined in:
- lib/uttk/strategies/Block.rb
Overview
I can evaluate a Ruby block. The test fails if block raise an excption or return a false/nil value.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Strategy
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from IOBased
#initialize, #stream, #stream_class=
Methods inherited from Strategy
#abort, #assert_cmd, #assign, #clean_instance_variables, #display_unexpected_exc, #display_unexpected_synflow_exc, #fail, #initialize, #initialize_flow_factory, #mk_system_runner, #name=, #pass, #raise_error, #reject, #run, #running?, #skip, #skip_if_cached, #skip_pass, #skip_wrt_rpath_and_rpath_exclude, #strategy, #strategy=, #symbols=, #symtbl, #symtbl=, #testify, #timeout=, to_form, #to_s, to_yaml_type, #wclass=
Constructor Details
This class inherits a constructor from Uttk::Strategies::IOBased
Class Method Details
.create(*a, &block) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/uttk/strategies/Block.rb', line 17 def self.create ( *a, &block ) raise ArgumentError, 'need a block' if block.nil? strategy = new(*a) strategy.test = block strategy end |
Instance Method Details
#test=(block1 = nil, &block2) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/uttk/strategies/Block.rb', line 25 def test=(block1=nil, &block2) if block2 @test = block2 elsif not block1.nil? @test = block1 else raise ArgumentError, 'no block given' end end |