Ruby 为什么赢了';这次考试不及格吗?
在调试这个Ruby单元测试时遇到了麻烦,但不知道我做错了什么。代码如下: 我的问题是最好的句子选择方法;以下是Textmate给我的回复: 你能帮忙吗?谢谢大家! 在这条线上Ruby 为什么赢了';这次考试不及格吗?,ruby,unit-testing,syntax-error,Ruby,Unit Testing,Syntax Error,在调试这个Ruby单元测试时遇到了麻烦,但不知道我做错了什么。代码如下: 我的问题是最好的句子选择方法;以下是Textmate给我的回复: 你能帮忙吗?谢谢大家! 在这条线上 WordPlay.best_sentence(['This is a test', 'This is another test', 'This is a great test'] %w{test great this})) 第一个参数后似乎没有逗号。然后有两个右括号,但只有一个左括号 请考虑编辑您的问题,使代码更可读(提
WordPlay.best_sentence(['This is a test', 'This is another test', 'This is a great test'] %w{test great this}))
第一个参数后似乎没有逗号。然后有两个右括号,但只有一个左括号
请考虑编辑您的问题,使代码更可读(提示:如果一行从4个空格开始,前面是一个空行,它看起来像代码)。< /P>请正确地格式化您的代码。
/Users/pdenlinger/ruby/wordplaylib/wordplaytest.rb:23: syntax error, unexpected tQWORDS_BEG, expecting ')'
%w{test great this}))
^
/Users/pdenlinger/ruby/wordplaylib/wordplaytest.rb:23: syntax error, unexpected ')', expecting kEND
%w{test great this}))
^
WordPlay.best_sentence(['This is a test', 'This is another test', 'This is a great test'] %w{test great this}))