module Screenplay::Scenarios
Public Instance Methods
autoload()
click to toggle source
# File lib/screenplay/scenarios.rb, line 18 def autoload @path = $SCREENPLAY_SCENARIOS_DIR || Configuration[:general][:scenarios_dir] rescue File.join(Configuration.path, 'scenarios') load_path(@path) end
each() { |k| ... }
click to toggle source
# File lib/screenplay/scenarios.rb, line 32 def each @scenarios.each { | k | yield k } end
load_path(path)
click to toggle source
# File lib/screenplay/scenarios.rb, line 23 def load_path(path) yml_files = File.join(path, '**', '*.{yaml,yml}') Dir[yml_files].each { | filename | register(filename) } end
register(filename)
click to toggle source
# File lib/screenplay/scenarios.rb, line 12 def register(filename) name = filename.gsub(@path, '').gsub(/^\//, '') unless @path.empty? @scenarios.push(Scenario.new(name, filename)) @scenarios.sort_by{ | actor | actor.name } end
size()
click to toggle source
# File lib/screenplay/scenarios.rb, line 28 def size @scenarios.size end