Class: Specific::Loader
- Inherits:
-
Object
- Object
- Specific::Loader
- Defined in:
- lib/specific/loader.rb
Instance Attribute Summary collapse
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
Instance Method Summary collapse
-
#initialize(path = 'features') ⇒ Loader
constructor
A new instance of Loader.
- #run ⇒ Object
Constructor Details
#initialize(path = 'features') ⇒ Loader
Returns a new instance of Loader.
5 6 7 8 9 10 |
# File 'lib/specific/loader.rb', line 5 def initialize(path = 'features') base_path = File.join(Dir.pwd, path) @path = File.join(base_path, '**', '*.feature') @spec = Specific::Base.new(base_path) end |
Instance Attribute Details
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
3 4 5 |
# File 'lib/specific/loader.rb', line 3 def spec @spec end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/specific/loader.rb', line 12 def run Dir[@path].each do |feature_file| feature_definition = File.read(feature_file) ast = GherkinRuby.parse(feature_definition) processor = Specific::Processor::Gherkin.new(@spec) processor.execute(ast) end end |