Sha256: 143a81179b548a85f7da169af0e2bb5ee04547be16a05ee128f36b4cdb230d18
Contents?: true
Size: 1.13 KB
Versions: 10
Compression:
Stored size: 1.13 KB
Contents
require 'cucumber/runtime/features_loader' module JCukeForker # # CukeForker::Scenarios.by_args(args) # # where 'args' is a String of cucumber options # # For example: # CukeForker::Scenarios.by_args(%W[-p my_profile -t @edition]) # will return an array of scenarios and their line numbers that match # the tags specified in the cucumber profile 'my_profile' AND have the '@edition' tag # class Scenarios def self.by_args(args) options = Cucumber::Cli::Options.new(STDOUT, STDERR, :default_profile => 'default') tagged(options.parse!(args)[:tag_expressions]) end def self.all any_tag = [] tagged any_tag end def self.tagged(tags) tag_expression = Gherkin::TagExpression.new(tags) scenario_line_logger = JCukeForker::Formatters::ScenarioLineLogger.new(tag_expression) loader = Cucumber::Runtime::FeaturesLoader.new(feature_files, [], tag_expression) loader.features.each do |feature| feature.accept(scenario_line_logger) end scenario_line_logger.scenarios end def self.feature_files Dir.glob('**/**.feature') end end end
Version data entries
10 entries across 10 versions & 1 rubygems