我正在做 TestFirst.org 的 Learn Ruby 教程,目前正在练习第 3 号 Simon Says。我不确定这是否是一个问题,或者它是否会干扰我使用 rspec 进行的测试(并给我错误的结果),但终端会在显示我的所有测试已通过之前打印出一些错误消息。
caitlyns-mbp:03_simon_says caitlynyu$ rake
(in /Users/caitlynyu/Desktop/learn_ruby)
/Users/caitlynyu/Desktop/learn_ruby/03_simon_says/simon_says_spec.rb:62: warning: possibly useless use of == in void context
/Users/caitlynyu/Desktop/learn_ruby/03_simon_says/simon_says_spec.rb:63: warning: possibly useless use of == in void context
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
Simon says
repeat
should repeat
should repeat a number of times
echo
should echo hello
should echo bye
start_of_word
returns the first letter
returns the first several letters
returns the first two letters
shout
should shout hello
should shout multiple words
first_word
tells us the first word of 'Hello World' is 'Hello'
tells us the first word of 'oh dear' is 'oh'
titleize
doesn't capitalize 'little words' in a title
does capitalize 'little words' at the start of a title
capitalizes every word (aka title case)
capitalizes a word
Finished in 0.00324 seconds
15 examples, 0 failures
Randomized with seed 36160
它对 simon_says_spec.rb 发出警告,但这是 TestFirst Learn Ruby 教程提供的规范。为什么会有这个问题?另外,它说“所有示例都被过滤掉了”是一个大问题吗?忽略 {:focus=>true|}'?