Ruby on rails 在windows上使用spork运行两次Cucumber测试
我在windows7上运行 我可以带着和不带斯波克跑黄瓜 没有斯波克,它是非常缓慢的。 有了Spork,测试运行了两次,你知道为什么吗 如果我启动spork:Ruby on rails 在windows上使用spork运行两次Cucumber测试,ruby-on-rails,cucumber,spork,Ruby On Rails,Cucumber,Spork,我在windows7上运行 我可以带着和不带斯波克跑黄瓜 没有斯波克,它是非常缓慢的。 有了Spork,测试运行了两次,你知道为什么吗 如果我启动spork: bundle exec spork cucumber &然后使用cumber运行测试。测试首先运行得非常快,我得到以下输出 Spork is no longer supported as of Cucumber 1.3.0. Please downgrade to version 1.2.5 Disabling profiles...
bundle exec spork cucumber
&然后使用cumber运行测试。测试首先运行得非常快,我得到以下输出
Spork is no longer supported as of Cucumber 1.3.0. Please downgrade to version 1.2.5 Disabling profiles...
.....test o/p
10 scenarios (10 passed) 69 steps (69 passed) 0m1.010s WARNING: No DRb server is running. Running features locally: WARN: Unresolved specs during Gem::Specification.reset:
builder (>= 2.1.2, ~> 3.1)
mime-types (>= 1.16, ~> 1.16)
treetop (~> 1.4.8)
rake (>= 0.8.7)
sprockets-rails (~> 2.0) WARN: Clearing out unresolved specs. Please report a bug if this causes problems. DL is deprecated, please use Fiddle Using the default profile... Feature: authentication pages
.....test o/p
然后测试再次运行,但速度很慢,就好像spork没有运行一样
rails-版本
rails --version
DL is deprecated, please use Fiddle
Rails 4.1.1
捆绑秀
C:\Sites\rails_projects\sample_app2>bundle show
Gems included by the bundle:
* actionmailer (4.1.1)
* actionpack (4.1.1)
* actionview (4.1.1)
* activemodel (4.1.1)
* activerecord (4.1.1)
* activesupport (4.1.1)
* arel (5.0.1.20140414130214)
* bcrypt (3.1.7)
* bootstrap-sass (2.3.2.0)
* builder (3.2.2)
* bundler (1.3.5)
* capybara (2.3.0)
* celluloid (0.15.2)
* childprocess (0.5.3)
* coderay (1.1.0)
* coffee-rails (4.0.1)
* coffee-script (2.2.0)
* coffee-script-source (1.7.0)
* cucumber (1.3.15)
* cucumber-rails (1.4.1)
* database_cleaner (1.3.0)
* diff-lcs (1.2.5)
* erubis (2.7.0)
* execjs (2.2.0)
* factory_girl (4.2.0)
* factory_girl_rails (4.2.1)
* ffi (1.9.3)
* formatador (0.2.5)
* gherkin (2.12.2)
* guard (2.6.1)
* guard-spork (1.5.1)
* haml (4.0.5)
* hike (1.2.3)
* i18n (0.6.9)
* jbuilder (2.1.0)
* jquery-rails (3.1.0)
* json (1.8.1)
* listen (2.7.7)
* lumberjack (1.0.6)
* mail (2.5.4)
* method_source (0.8.2)
* mime-types (1.25.1)
* mini_portile (0.6.0)
* minitest (5.3.4)
* multi_json (1.10.1)
* multi_test (0.1.1)
* nokogiri (1.6.2.1)
* pg (0.17.1)
* polyglot (0.3.5)
* pry (0.10.0)
* rack (1.5.2)
* rack-test (0.6.2)
* rails (4.1.1)
* rails_12factor (0.0.2)
* rails_serve_static_assets (0.0.2)
* rails_stdout_logging (0.0.3)
* railties (4.1.1)
* rake (10.3.2)
* rb-fsevent (0.9.4)
* rb-inotify (0.9.5)
* rdoc (4.1.1)
* rspec-collection_matchers (1.0.0)
* rspec-core (2.99.0)
* rspec-expectations (2.99.0)
* rspec-its (1.0.1)
* rspec-mocks (2.99.0)
* rspec-rails (2.99.0)
* sass (3.2.19)
* sass-rails (4.0.3)
* sdoc (0.4.0)
* shoulda-matchers (2.6.1)
* slop (3.5.0)
* spork (1.0.0rc4)
* spork-rails (4.0.0)
* spring (1.1.3)
* sprockets (2.11.0)
* sprockets-rails (2.1.3)
* sqlite3 (1.3.9)
* therubyrhino (2.0.3)
* therubyrhino_jar (1.7.4)
* thor (0.19.1)
* thread_safe (0.3.4)
* tilt (1.4.1)
* timers (1.1.0)
* treetop (1.4.15)
* turbolinks (2.2.2)
* tzinfo (1.2.1)
* tzinfo-data (1.2014.3)
* uglifier (2.5.0)
* win32-process (0.7.4)
* win32console (1.3.2)
* xpath (2.0.0)
gem文件:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.1'
gem 'bootstrap-sass', '2.3.2.0'
gem 'sprockets', '2.11.0'
gem 'bcrypt', '~> 3.1.2'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development
gem 'execjs'
#gem 'therubyracer'
gem 'therubyrhino'
gem 'haml'
gem 'sass'
gem 'tzinfo-data'
group :development, :test do
gem 'rspec-rails', '~> 2.0'
gem 'rspec-its'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
gem 'spork-rails' #, '4.0.0'
gem 'guard-spork' #, '1.5.0'
gem 'childprocess' #, '0.3.6'
end
group :test do
gem 'cucumber-rails',require: false
gem 'database_cleaner'
gem 'shoulda-matchers'
gem 'factory_girl_rails', '~> 4.2.1'
#gem 'factory_girl'
end
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
group :production do
gem 'pg'
gem 'rails_12factor'
end
我在网上找到的关于下面信息的唯一参考资料告诉我,我可以忽略这一点。我试着用cucumber&cucumber rails的gem版本来进行搜索,但我总是得到一些线索
Spork is no longer supported as of Cucumber 1.3.0. Please downgrade to version 1.2.5 Disabling profiles...
回答我自己的问题 我知道这不是正确的答案,但在没有其他任何东西的情况下,这是可行的 在文件C:\RailsInstaller\Ruby2.0.0\lib\ruby\gems\2.0.0\gems\cucumber-1.3.15\lib\cucumber\cli\drb_client.rb中,我在第24行注释了引发异常的原因,如下所示:
rescue DRb::DRbConnError
STDERR.puts DRbClientError
#commented by BillComer
#raise DRbClientError, "No DRb server is running."
这样做的缺点是您必须运行Spork,因为注释掉它实际上会禁用返回运行非Spork变体的代码