繁体   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