【发布时间】:2014-12-13 04:20:14
【问题描述】:
我是编程新手,目前正在自学。我首先关注应用学院的 precourse。 我在尝试让第一个规范在第一个项目 00_hello 上运行时遇到了很多麻烦。
我正在使用 Windows 7 pc 64 位,在我不得不使用 rspec 之前,我在其上运行 Ruby 并没有遇到太多问题。
我也有一个运行 Mac OS X 的 VM,但我也遇到了类似的问题。
我在运行 00_hello_spec 时遇到的当前错误是
D:/1/spec/00_hello_spec.rb:105:in
<main>': undefined methoddescribe' for main :Object (NoMethodError)
这是我第一次使用 rspec,非常感谢任何帮助正确设置和运行它。
这里是00_hello_spec.rb的内容:
require "00_hello"
describe "the hello function" do
it "says hello" do
hello.should == "Hello!"
end
end
describe "the greet function" do
it "says hello to someone" do
greet("Alice").should == "Hello, Alice!"
end
it "says hello to someone else" do
greet("Bob").should == "Hello, Bob!"
end
end
【问题讨论】:
-
rspec 似乎没有加载
-
我已经安装了 rspec