Sha256: 0051bdb8cc3968eeb4e94c2adae2e0c1bbc9a864792319ac3758279a3faa9d35

Contents?: true

Size: 822 Bytes

Versions: 2

Compression:

Stored size: 822 Bytes

Contents

require 'cucumber/core'
require 'cucumber/core/filter'

module CukeForker
  class Scenarios
    include Cucumber::Core

    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)
      scenario_list = ScenarioList.new
      feature_files.each do |feature|
        source = CukeForker::NormalisedEncodingFile.read(feature)
        file = Cucumber::Core::Gherkin::Document.new(feature, source)
        self.new.execute([file], scenario_list, [Cucumber::Core::Test::TagFilter.new(tags)])
      end
      scenario_list.scenarios
    end

    def self.feature_files
      Dir.glob('**/**.feature')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cukeforker-1.1.0 lib/cukeforker/scenarios.rb
cukeforker-1.0.0 lib/cukeforker/scenarios.rb