簡體   English   中英

當試圖在Rubymine上運行rspec時,沒有發現任何測試

[英]'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

編輯: 這是我的stacktrace的副本

有任何想法嗎?

定義上下文的rspec關鍵字是describe ,而不是define

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM