Class: Mutant::Meta::Example::DSL
- Inherits:
-
Object
- Object
- Mutant::Meta::Example::DSL
- Includes:
- AST::Sexp
- Defined in:
- lib/mutant/meta/example/dsl.rb
Overview
Example DSL
Class Method Summary collapse
-
.run(file, block) ⇒ Example
private
Run DSL on block.
Instance Method Summary collapse
-
#example ⇒ Example
private
Example captured by DSL.
-
#initialize(file) ⇒ undefined
constructor
private
Initialize DSL context.
Constructor Details
#initialize(file) ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize DSL context
25 26 27 28 29 |
# File 'lib/mutant/meta/example/dsl.rb', line 25 def initialize(file) @file = file @source = nil @expected = [] end |
Class Method Details
.run(file, block) ⇒ Example
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Run DSL on block
14 15 16 17 18 |
# File 'lib/mutant/meta/example/dsl.rb', line 14 def self.run(file, block) instance = new(file) instance.instance_eval(&block) instance.example end |
Instance Method Details
#example ⇒ Example
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Example captured by DSL
39 40 41 42 |
# File 'lib/mutant/meta/example/dsl.rb', line 39 def example fail 'source not defined' unless @source Example.new(@file, @source, @expected) end |