Sha256: 2360e0294790261608ab19b00aa76c8e6f2d7905f4ee3aa74b89ef2cf28290e3

Contents?: true

Size: 1.03 KB

Versions: 72

Compression:

Stored size: 1.03 KB

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' && ::Cucumber::VERSION < '1.0.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::VERSION < '1.0.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

72 entries across 72 versions & 3 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb
classiccms-0.7.4 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb
classiccms-0.7.3 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb
spork-1.0.0rc4 lib/spork/test_framework/cucumber.rb
spork-1.0.0rc4-x86-mswin32 lib/spork/test_framework/cucumber.rb
spork-1.0.0rc4-x86-mingw32 lib/spork/test_framework/cucumber.rb
classiccms-0.7.2 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb
classiccms-0.7.1 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb
classiccms-0.7.0 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb
classiccms-0.6.9 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb
classiccms-0.6.8 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb
classiccms-0.6.7 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb
classiccms-0.6.6 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb
classiccms-0.6.5 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb
classiccms-0.6.4 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb
classiccms-0.6.3 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb
classiccms-0.6.2 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb
classiccms-0.6.1 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb
classiccms-0.6.0 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb
classiccms-0.5.17 vendor/bundle/gems/spork-0.9.0/lib/spork/test_framework/cucumber.rb