我正在关注 Michael Hartl 教程的第 5 章。当我从根目录运行以下命令时,
$ bundle exec rspec spec/
我收到以下错误:
No DRb server is running. running in local process instead ...
c:/sites/sample_app/spec/helpers/applcation_helper_spec.rb:1:in '<top required>>': uninitialized constant ApplicationHelper (NameError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:746:in 'loud'
.
.
我想我应该尝试找出哪些文件失败了,我发现 2 个文件出现了上述错误(其余的文件运行了测试并通过了 0 个失败)。失败的有:
1) 规范/帮助者/application_helper_spec.rb
describe ApplicationHelper do
describe "full_title" do
it "should include the page name" do
full_title("foo").should =~ /foo/
end
it "should include the base name" do
full_title("foo").should =~ /^Ruby on Rails Tutorial Sample App/
end
it "should not include a bar for the home page" do
full_title("").should_not =~ /\|/
end
end
end
2) 规范/支持/实用程序.rb
include ApplicationHelper