Class: TestQueue::TestFramework::Cucumber

Inherits:
TestQueue::TestFramework show all
Defined in:
lib/test_queue/runner/cucumber.rb

Defined Under Namespace

Classes: FakeKernel

Instance Method Summary collapse

Instance Method Details

#all_suite_filesObject



92
93
94
95
96
97
98
# File 'lib/test_queue/runner/cucumber.rb', line 92

def all_suite_files
  if runtime.respond_to?(:feature_files, true)
    runtime.send(:feature_files)
  else
    cli.configuration.feature_files
  end
end

#cliObject



84
85
86
# File 'lib/test_queue/runner/cucumber.rb', line 84

def cli
  @cli ||= ::Cucumber::Cli::Main.new(ARGV.dup, $stdin, $stdout, $stderr, FakeKernel.new)
end

#runtimeObject



88
89
90
# File 'lib/test_queue/runner/cucumber.rb', line 88

def runtime
  @runtime ||= ::Cucumber::Runtime.new(cli.configuration)
end

#suites_from_file(path) ⇒ Object



100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/test_queue/runner/cucumber.rb', line 100

def suites_from_file(path)
  if defined?(::Cucumber::Core::Gherkin::Document)
    source = ::Cucumber::Runtime::NormalisedEncodingFile.read(path)
    doc = ::Cucumber::Core::Gherkin::Document.new(path, source)
    [[File.basename(doc.uri), doc]]
  else
    loader =
      ::Cucumber::Runtime::FeaturesLoader.new([path],
                                              cli.configuration.filters,
                                              cli.configuration.tag_expression)
    loader.features.map { |feature| [feature.title, feature] }
  end
end