简体   繁体   中英

'No tests were found' when trying to run rspec on Rubymine

I'm trying to do a Ruby Kada, but when I try to run my spec, I get "No tests were found."

I have 2 files in my project:

poker_hands.rb , which contains:

def announce_winner (s)
   'Player x is the winner.'
end

and poker_hands_spec.rb , which contains:

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

I'm running RubyMine 4.0.3 and rspec 2.10.0

edit: Here is a copy of my stacktrace

Any ideas?

定义上下文的rspec关键字是describe ,而不是define

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM