【发布时间】:2015-04-25 18:07:12
【问题描述】:
我遇到语法错误的问题,但我不明白为什么。我正在做“The Rspec book”的例子,但我已经到了无法继续的地步。当我在控制台 rspec spec/codebreaker/game_spec.rb --format doc 中写入时,我得到的只是这条消息:语法错误,意外的关键字_end,期望输入结束(SyntaxError)我已经修复了这个错误数千次,但是无论我现在做什么,我都无法弄清楚发生了什么。
这是spec/codebreaker/game_spec.rb的代码
require 'spec_helper'
module Codebreaker
describe Game do
describe "#start" do
it "sends a welcome message"
output = double('output')
game = Game.new(output)
output.should_receive(:puts).with('Welcome to Codebreaker!')
game.start
end
it "prompts for the first guess"
end
end
end
我添加了另一个“结束”,我也删除了它,但它没有任何作用。可能是我错过了关于不推荐使用的语法或其他东西的东西。非常感谢。
【问题讨论】: