Ich habe bestehende rspecs und Gurken-Funktionen alle gut läuft.Gurke funktioniert gut ohne Spork, aber Spork gibt mir "nicht initialisierte konstante Gurke :: Rails"
Ich installiere Spork (spork-rails in der Tat), um mir etwas schneller laufen zu lassen.
Ich habe rspec läuft gut mit spork.
Ich habe gerade die env.rb nach Anweisungen geändert (sehr ähnlich den Mods zu Spec_helper.rb), aber ich bekomme uninitialized constant Cucumber::Rails
, wenn ich versuche, bundle exec cucubmer --drb
zu laufen.
Rails 3.2 durch die Art und Weise Irgendwelche Ideen
?
Hier ist mein env.rb:
require 'rubygems'
require 'spork'
#uncomment the following line to use spork with the debugger
require 'spork/ext/ruby-debug'
if Spork.using_spork?
Spork.prefork do
require 'rails'
require 'cucumber/rails'
Capybara.default_selector = :css
begin
DatabaseCleaner.strategy = :transaction
rescue NameError
raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
end
end
Spork.each_run do
# This code will be run each time you run your specs.
require 'cucumber/rails'
Cucumber::Rails::Database.javascript_strategy = :truncation
ActionController::Base.allow_rescue = false
module NavigationHelpers
def path_to(page_name)
case page_name
when /the home page/
root_path
# Add more page name => path mappings here
else
if path = match_rails_path_for(page_name)
path
else
raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
"Now, go and add a mapping in features/support/paths.rb"
end
end
end
def match_rails_path_for(page_name)
if page_name.match(/the (.*) page/)
return send "#{$1.gsub(" ", "_")}_path" rescue nil
end
end
end
World(NavigationHelpers)
end
else
#omitted
end