[英]'No tests were found' when trying to run rspec on Rubymine
我正在嘗試做一個Ruby Kada,但是當我嘗試運行我的規范時,我得到“沒有找到測試。”
我的項目中有2個文件:
poker_hands.rb
,其中包含:
def announce_winner (s)
'Player x is the winner.'
end
和poker_hands_spec.rb
,其中包含:
require 'rspec'
require 'poker_hands'
define 'poker_hands' do
it 'should announce a winner' do
x = announce_winner('')
x.should == 'Player x is the winner.'
end
end
我正在運行RubyMine 4.0.3和rspec 2.10.0
有任何想法嗎?
定義上下文的rspec關鍵字是describe
,而不是define
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.