- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试让 spork 与 Rails 2.3.18 应用程序一起工作
这是我的 gemfile 的一部分,显示了 Rspec 版本:
gem "rails", "2.3.18"
gem "haml", "3.1.8"
gem "twitter", :git => "git://github.com/sferik/twitter.git", :tag => "v0.9.12"
gem 'rdoc', '~> 3.9.2'
group :test, :development do
gem "rspec", "1.3.1"
# gem 'rspec-mocks', '2.1.0'
# gem 'rspec-core', '2.1.0'
# gem 'rspec-expectations', '2.1.0'
gem "rspec-rails", "1.3.4"
# gem 'guard'
# gem 'guard-livereload'
# gem 'rb-fsevent', '~> 0.9'
# gem 'em-websocket'
gem 'spork'
end
这是我的 spec_helper.rb
require 'rubygems'
require 'spork'
#require 'spork/ext/ruby-debug'
Spork.prefork do
# Loading more in this block will cause your tests to run faster. However,
# if you change any configuration or code from libraries loaded here, you'll
# need to restart spork for it take effect.
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
ENV["RAILS_ENV"] = 'test'
require File.expand_path(File.join(File.dirname(__FILE__),'..','config','environment'))
require 'spec/autorun'
require 'spec/rails'
# Uncomment the next line to use webrat's matchers
#require 'webrat/integrations/rspec-rails'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
Spec::Runner.configure do |config|
# If you're not using ActiveRecord you should remove these
# lines, delete config/database.yml and disable :active_record
# in your config/boot.rb
config.use_transactional_fixtures = true
config.use_instantiated_fixtures = false
config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
# == Fixtures
#
# You can declare fixtures for each example_group like this:
# describe "...." do
# fixtures :table_a, :table_b
#
# Alternatively, if you prefer to declare them only once, you can
# do so right here. Just uncomment the next line and replace the fixture
# names with your fixtures.
#
# config.global_fixtures = :table_a, :table_b
#
# If you declare global fixtures, be aware that they will be declared
# for all of your examples, even those that don't use them.
#
# You can also declare which fixtures to use (for example fixtures for test/fixtures):
#
# config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
#
# == Mock Framework
#
# RSpec uses its own mocking framework by default. If you prefer to
# use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
#
# == Notes
#
# For more information take a look at Spec::Runner::Configuration and Spec::Runner
end
end
Spork.each_run do
# This code will be run each time you run your specs.
end
# --- Instructions ---
# Sort the contents of this file into a Spork.prefork and a Spork.each_run
# block.
#
# The Spork.prefork block is run only once when the spork server is started.
# You typically want to place most of your (slow) initializer code in here, in
# particular, require'ing any 3rd-party gems that you don't normally modify
# during development.
#
# The Spork.each_run block is run each time you run your specs. In case you
# need to load files that tend to change during development, require them here.
# With Rails, your application modules are loaded automatically, so sometimes
# this block can remain empty.
#
# Note: You can modify files loaded *from* the Spork.each_run block without
# restarting the spork server. However, this file itself will not be reloaded,
# so if you change any of the code inside the each_run block, you still need to
# restart the server. In general, if you have non-trivial code in this file,
# it's advisable to move it into a separate file so you can easily edit it
# without restarting spork. (For example, with RSpec, you could move
# non-trivial code into a file spec/support/my_helper.rb, making sure that the
# spec/support/* files are require'd from inside the each_run block.)
#
# Any code that is left outside the two blocks will be run during preforking
# *and* during each_run -- that's probably not what you want.
#
# These instructions should self-destruct in 10 seconds. If they don't, feel
# free to delete them.
Spork 启动成功。
当我运行时
./script/spec spec
测试成功运行。但是,如果我像这样传递 --drb 选项
./script/spec spec --drb
我明白了
Exception encountered: #<NameError: uninitialized constant RSpec>
最佳答案
必须使用 gem 'spork', '~> 0.8.0'
关于ruby-on-rails - 带有 spork 的未初始化常量 RSpec,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16597792/
每当我运行 spork 时,我都会得到 $ spork Using RSpec Preloading Rails environment Loading Spork.prefork block...
我关注了 "How I Test" screencast at RailsCasts ,但是我遇到了 spork 的问题 $ guard Guard is now watching at '/User
当我用 spork 运行我的 rspec 测试时,每次我使用 capybara 的 save_and_open_page 时,spork 都会丢失测试套件......或者可能不再输出任何东西.....
我按照 Michael Hartl 的 Rails 教程使用 Spork 运行 Guard,我遇到了这个问题。以下是错误信息: 20:45:58 - INFO - Starting Spork for
如果我在我的 rails 项目中使用 spork 并且有一个像这样的 spec_helper.rb 文件 require 'spork' Spork.prefork do ... end Spor
我现有的 rspecs 和 Cucumber 功能都运行良好。 我正在安装 spork(实际上是 spork-rails)以提高重新运行速度。 我有 spork 的 rspec 运行良好。 我刚刚按照
我花了好几个小时试图配置 spork,以便它适用于 RSpec,适用于 Cucumber,重新加载模型,以便它不必一直重新启动并且不会抛出错误。 我花了很多时间研究其怪癖的解决方案,以至于我可能只是等
我有一个 spork gem 问题。每次运行 spork 命令时,都会出现这个长错误: evan@TheBeast-Computer:~/rails_projects/sample_app$ spor
我正在使用以下 gem 和 ruby-1.9.3-p194 : rails 3.2.3 rspec-rails 2.9.0 spork 1.0.0rc2 guard - pig 肉 0.6.1 此 G
我使用 spork 作为我的 DRB 和 autotest 作为我的观察者来加速我的 Rails 应用程序中的测试。目前,autotest 会在目录结构中的文件 发生更改时重新启动测试。 有没有办法在
我整天都在使用spork,在大多数情况下,这确实很棒。 但是,我经常遇到一些问题,需要重新启动Spork才能通过测试...现在,我想知道这是否比它值得的麻烦更多。我是ruby的新手,所以有时我无法预测
我正在使用 RSpec 进行 Rails 3 测试并尝试使用 Spork。 我遵循了几个教程,Spork 似乎没有错误地运行,但是我的测试在打开和关闭 Spork 的情况下仍然需要相同的时间来运行(4
我使用 spork 和 guard 来加速我的 Rails 3.2 应用程序中的测试套件。然而,在添加新迁移后,guard 中的测试表现得很奇怪:它们的行为就像它们不知道架构中的变化一样,即使我之前运
谁能解释一下如何将 Spork 与 Minitest 一起使用。我看到有一个 spork-minitest gem , 但不清楚如何使用它。 最佳答案 将其添加到 Gemfile 后,您可以使用 ht
因此,在 Rails 3.0.9 应用程序上,我在 1.9.2 上使用了 Spork/Guard/RSpec/FactoryGirl。 我想知道如何让 Spork/Guard 自动更新我的工厂和语言环
我正在按照 http://ruby.railstutorial.org/ 上的教程开发我的第一个 Rails 应用程序.我已经完全按照教程中的说明设置了我的开发环境(我正在使用带有 Lion 的 Ma
我正在使用以下技巧(来自 http://mikbe.tk/2011/02/10/blazingly-fast-tests/ )来确保在每次使用 Spork 运行 RSpec 时重新加载模型: Spor
使用Spork时如何加载Machinist的蓝图? gem : mongoid (2.0.0.rc.6) capybara (0.4.1.1) 牛排 (1.1.0) spork (0.9.0.rc2)
我正在尝试使用 spork 加速 Rails 2.3.8 应用程序中的“rspecing”。当我在项目的根目录中运行 spork 时,我得到: (...stuff...) No server is r
我在命令行上运行 spork --bootstrap 并收到错误 -bash: spork: command not found 我知道我已经安装了 spork,因为当我运行 bundle show
我是一名优秀的程序员,十分优秀!