Fix cucumber support #105

Merged
merged 2 commits into from Sep 17, 2012

3 participants

@b4mboo

This fixes cucumber test runs for me. However, I'm actually not
quite sure whether it would be better to create a new Cucumber::Runtime
instance everytime. I'm just not deep enough into your code at this
point.

Nevertheless, cucumber tests are running with that patch. Thanks!

Dominik Bamberger Remember cucumber_runtime in a class variable
This fixes cucumber test runs for me. However, I'm actually not
quite sure whether it would be better to create a new Cucumber::Runtime
instance everytime. I'm just not deep enough into your code at this
point.

Nevertheless, cucumber tests are running with that patch. Thanks!
3fb70c7
Dominik Bamberger ignore rubymine 37d1e88
@jcf

For those who having problems with this now, I've added working cucumber methods to my subclass of Zeus::Rails.

require 'zeus/rails'

class ExtendedZeusPlan < Zeus::Rails
  def dbconsole
    require 'rails/commands/dbconsole'

    meth = Rails::DBConsole.method(:start)

    # `Rails::DBConsole.start` has been changed to load faster in 
    # https://github.com/rails/rails/commit/346bb018499cde6699fcce6c68dd7e9be45c75e1
    #
    # This will work with both versions.
    if meth.arity.zero?
      Rails::DBConsole.start
    else
      Rails::DBConsole.start(Rails.application)
    end
  end

  def cucumber_environment
    require 'cucumber/rspec/disable_option_parser'
    require 'cucumber/cli/main'
    @cucumber_runtime = Cucumber::Runtime.new
  end

  def cucumber
    cucumber_main = Cucumber::Cli::Main.new(ARGV.dup)
    exit cucumber_main.execute!(@cucumber_runtime)
  end
end

Zeus.plan = ExtendedZeusPlan.new
@b4mboo b4mboo referenced this pull request Sep 17, 2012
Closed

Cucumber Support #55

@burke burke merged commit 8dfc275 into burke:master Sep 17, 2012
@burke
Owner

I was sure I had fixed this myself, but... apparently not! Thanks!

@simi simi commented on the diff Nov 20, 2012
.gitignore
@@ -24,3 +24,4 @@ rubygem/build/*
go/zeusversion/zeusversion.go
.DS_Store
ext/fsevents/build/*
+.idea/
@simi
simi added a line comment Nov 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment