Sha256: d8521dad5fdcea2bcdf9bf13037fe28c48ff6efbd3a13867573523d87cfcfc64

Contents?: true

Size: 989 Bytes

Versions: 7

Compression:

Stored size: 989 Bytes

Contents

class Spork::TestFramework::Cucumber < Spork::TestFramework
  DEFAULT_PORT = 8990
  HELPER_FILE = File.join(Dir.pwd, "features/support/env.rb")

  class << self
    # REMOVE WHEN SUPPORT FOR 0.3.95 AND EARLIER IS DROPPED
    attr_accessor :mother_object
  end

  def preload
    require 'cucumber'
    if ::Cucumber::VERSION >= '0.9.0'
      # nothing to do nowadays
    else
      preload_legacy_cucumbers
    end
    super
  end

  def run_tests(argv, stderr, stdout)
    if ::Cucumber::VERSION >= '0.9.0'
      ::Cucumber::Cli::Main.new(argv, stdout, stderr).execute!
    else
      ::Cucumber::Cli::Main.new(argv, stdout, stderr).execute!(@step_mother)
    end
  end

  private
  
  def preload_legacy_cucumbers
    begin
      @step_mother = ::Cucumber::Runtime.new
      @step_mother.load_programming_language('rb')
    rescue NoMethodError => pre_cucumber_0_4 # REMOVE WHEN SUPPORT FOR PRE-0.4 IS DROPPED
      @step_mother = Spork::Server::Cucumber.mother_object
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spork-0.9.0.rc8-x86-mswin32 lib/spork/test_framework/cucumber.rb
spork-0.9.0.rc8-x86-mingw32 lib/spork/test_framework/cucumber.rb
spork-0.9.0.rc8 lib/spork/test_framework/cucumber.rb
spork-0.9.0.rc7 lib/spork/test_framework/cucumber.rb
spork-0.9.0.rc6 lib/spork/test_framework/cucumber.rb
spork-0.9.0.rc5 lib/spork/test_framework/cucumber.rb
spork-0.9.0.rc4 lib/spork/test_framework/cucumber.rb