我正在在线查看本教程: https ://www.relishapp.com/rspec/docs/gettingstarted
# game_spec.rb
describe Game do
describe "#score" do
it "returns 0 for all gutter game" do
game = Game.new
20.times { game.roll(0) }
game.score.should == 0
end
end
end
运行第一个示例,我注意到他们列出的错误消息比我看到的要短得多。在我的终端上,堆栈跟踪太长了,它会从顶部滚动。有没有办法缩短错误消息/堆栈输出以使其适合?
/testspec/game_spec.rb:3:in `<top (required)>': uninitialized constant Game (NameError)
from /.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `load'
from /.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `block in load_spec_files'
from /.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `each'
from /.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `load_spec_files'
from /.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.12.2/lib/rspec/core/command_line.rb:22:in `run'
from /.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:80:in `run'
from /.rvm/gems/ruby-1.9.3-p194/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:17:in `block in autorun'
我从那里的目录列表中删除了我的家庭目录。是否可以将详细程度简化为 NameError 行?