Sha256: 83faa85800f2fabf16a5ae362364a8d73ef728dfbf8fb41416cf8be5488634be

Contents?: true

Size: 892 Bytes

Versions: 1

Compression:

Stored size: 892 Bytes

Contents

require 'tork/config'

Tork::Config.all_test_file_globs << 'features/**/*.feature'

Tork::Config.test_file_globbers.update(
  # source files that correspond to test files
  %r<^features/(.+/)?step_definitions/.+\.rb$> => lambda do |path|
    path.sub %r<step_definitions/.+$>, '*.feature'
  end,

  # the actual test files themselves
  %r<^features/.+\.feature$> => lambda {|path| path }
)

Tork::Config.after_fork_hooks << lambda do |worker_number, log_file, test_file, test_names|
  # pass test_file in ARGV to cucumber(1) for running
  ARGV << test_file.dup
  require 'cucumber'
  require 'rubygems'
  cucumber_bin = Gem.bin_path('cucumber', 'cucumber')
  at_exit { load cucumber_bin unless $! }

  # noopify loading of test_file in Tork::Master#test()
  # because cucumber feature files are not Ruby scripts
  require 'tempfile'
  test_file.replace Tempfile.new('tork-cucumber').path
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tork-15.1.0 lib/tork/config/cucumber.rb