Tests are run but it says "No tests were found"?

I am able to successfully run the tests in RubyMine 3.0, but when I run the tests, I don't get the familiar green progress bar even when all the tests pass. It even shows the report of run tests, executed assertions, but the status bar is red and it continues to show "No tests were found".

Please see attached screenshot. (I am on Ubuntu 10.04 with JDK 1.6.0_22, FWIW).

Is this a bug?

Regards,
Kedar



Attachment(s):
no-test-were-found.png
13 comments
Comment actions Permalink

Hi,

Is test-unit gem required in Gemfile?

0
Comment actions Permalink

No, in fact, my Gemfile is clean. I haven't touched it. Here are its contents:

# A sample Gemfile
source "http://rubygems.org"

# gem "rails"

0
Comment actions Permalink

Seems our Test::Unit section in RubyMine help is needed to be updated (http://www.jetbrains.com/ruby/webhelp/test-unit-special-note.html). I've filed a task for our technical writers - http://youtrack.jetbrains.net/issue/RUBY-7328?query=%23%7BRuby+to+be+documented%7D.

Full featured Test::Unit test framework was removed from Ruby 1.9.x distribution. Ruby 1.9.x contains only minimal part of Test::Unit framework which isn't extendable and so RubyMine cannot automatically attach it to our GUI test runner. Please add dependency on 'test-unit' gem in Gemfile and install it.

0
Comment actions Permalink

There's some issue here. I am using rvm and my gemset that I have configured does have test-unit gem.

See attached.

It shows the gems, but continues to warn that I don't have test-unit gem installed/attached.

If I press on, add

gem "test-unit"

to Gemfile, nothing works. The test suit fails to load (that is it becomes worse than before).

Dazed and confused :(



Attachment(s):
rvm-gem-problem.png
0
Comment actions Permalink

Please restart RubyMine. Does it allow you to run Test::Unit run configurations after restart?

0
Comment actions Permalink

Restarted RubyMine. Now, the Settings screen correctly shows two gems available: bundler and test-unit.

But,
- with gem "test-unit" in Gemfile, it continues to fail with:

Testing started at 10:54 AM ...
Could not find gem 'test-unit (>= 0, runtime)' in any of the gem sources.
Empty test suite.

Process finished with exit code 7


- without gem "test-unit" in Gemfile, the previous behavior prevails (with red test status bar)

/usr/local/rvm/rubies/ruby-1.9.2-p0/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/kedar/RubymineProjects/ProgrammingRubyBook/integer_sequences_test.rb --name=test_squares_1
Testing started at 10:56 AM ...
Loaded suite /home/kedar/RubymineProjects/ProgrammingRubyBook/integer_sequences_test
Started
.
Finished in 0.000284 seconds.
1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
Test run options: --seed 64902 --name "test_squares_1"
Empty test suite.

Process finished with exit code 0

0
Comment actions Permalink

Please open settings of your test run configuration (e.g. RubyMine | Run | Edit Configurations), open "bundler" tab, is "bundle exec emulation" is checked?

0
Comment actions Permalink

Roman,

No, it was not. But then I enabled it.
See attached.

The results don't change, however. I continue to get red status bar and "No tests were found" message.

Regards,
Kedar



Attachment(s):
Screenshot-Run-Debug Configurations.png
0
Comment actions Permalink

Shameless bump. Any ideas?

0
Comment actions Permalink

As far as I understand it is just a sample project. Could you upload it somewhere. I can download and play with it. Looks like some simple configuration problem.

0
Comment actions Permalink

I was also seeing this with Rubymine 3.1, build 103-105, in Rails 3.0.5 and Ruby 1.9.2.  I added this line to my Gemfile:

gem 'test-unit'

...and ran 'bundle install'.  I did not need to restart Rubymine.

Then my tests were found.

(Previously, I had tried installing and attaching 'test-unit' from the "Settings" menu, with no success.)

Hope this helps,
-chris

0
Comment actions Permalink

Just to chime in, I too saw this exact same problem, but adding:

gem 'test-unit'

to the end of my Gemfile and then running bundle on the command line fixed it for me (no RM restart needed).

0
Comment actions Permalink

Ok, good. By the way "test-unit" gem is required for RubyMine on Ruby 1.9 SDK. For more details see RubyMine Help, section related to Test::Unit framework configuring.

0

Please sign in to leave a comment.