나는 잘 실행중인 기존 rspecs과 오이 기능을 가지고있어.오이,하지만 spork없이 잘 작동 spork 나에게주는 "초기화되지 않은 상수 오이 : : 레일"
다시 실행 속도를 높이기 위해 실제로 spork (spork-rails)을 설치하고 있습니다.
spsp와 함께 잘 실행되는 rspec이 있습니다.
지침에 따라 env.rb를 수정했습니다 (spec_helper.rb의 개조와 매우 유사 함). bundle exec cucubmer --drb
을 실행할 때 uninitialized constant Cucumber::Rails
이 표시됩니다.
어떤 아이디어로
레일 3.2 ?
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