我无法在列表3.9中运行非常基本的rspec测试我觉得我遗漏了一些非常基本的东西,导致static_pages_spec返回LoadError。有谁知道出了什么问题?
E:\ CSProj \ RailsTutorial \ sample_app> bundle exec rspec spec / request / static_pages_s pec.rb C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec /core/configuration.rb:780:in
中load': cannot load such file -- E:/CSProj/RailsTu torial/sample_app/spec/request/static_pages_spec.rb (LoadError) from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1 1.1/lib/rspec/core/configuration.rb:780:in
块中的load_spec_files' 来自C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1 1.1 / lib / rspec / core / configuration.rb:780:在map' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1 1.1/lib/rspec/core/configuration.rb:780:in
load_spec_files'中 来自C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1 1.1 / lib / rspec / core / command_line.rb:22:inrun' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1 1.1/lib/rspec/core/runner.rb:69:in
run' 来自C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1 1.1 / lib / rspec / core / runner.rb:8:在`block in autorun'
我使用以下代码:https://github.com/adoliver/sample_app/blob/static-pages/spec/requests/static_pages_spec.rb
require 'spec_helper'
describe "Static pages" do
describe "Home page" do
it "should have the content 'Sample App'" do
visit '/static_pages/home'
page.should have_content('Sample App')
end
end
end
Windows 7 使用railsInstaller 使用Windows native命令行 本教程中的先前步骤有效。
E:\ CSProj \ RailsTutorial \ sample_app> ruby -v ruby 1.9.3p125(2012-02-16)[i386-mingw32]
E:\ CSProj \ RailsTutorial \ sample_app> rails -v Rails 3.2.9
E:\ CSProj \ RailsTutorial \ sample_app>捆绑列表 捆绑包含的宝石:
答案 0 :(得分:0)
您报告:
load': cannot load such file -- E:/CSProj/RailsTu torial/sample_app/spec/request/static_pages_spec.rb (LoadError)
我不知道这是否愚蠢,但我的目录树中的规格位于/app/spec/requests
,而不是app/spec/request
。