Probably "Test::Unit" framework formatter ins't attached in run configuration settings. Please add screenshot of "test:units" run configuration. See RM | Run | Edit Configurations.. dialog
Does it matter if i inherit my testcases from ActiveSupport::TestCase instead of Test::Unit::TestCase ?
Not sure if it is pertinent, but this (and all my other) rails projects were created pre Rubymine and none were actually created by rubymine.
RubyMine should work in this case. You are using 1.8.6 (not 1.9) Ruby SDK, right? 1. Please show list of your gems ("gem list >> log.txt" command in console). Probably some of your gems conflicts with RubyMine's Test::Unit tests runner. 2. Create new "Empty" project in RubyMine, create any simple test unit test and launch it from context menu
Well it didnt fix it, but shows a new error now. If I remove test:unit from environment.rb I get 'uninitialized constant Test::Unit::UI::SILENT (NameError)'
C:/apps/ruby18/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant Test::Unit::UI::SILENT (NameError) from C:/apps/ruby18/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing' from C:/apps/ruby18/lib/ruby/1.8/test/unit/autorunner.rb:47 from C:/apps/ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from C:/apps/ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from C:/apps/ruby18/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require' from C:\Program Files (x86)\JetBrains\RubyMine 2.0.1\rb\testing\patch\testunit/test/unit/autorunner.rb:47 from C:/apps/ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from C:/apps/ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' ... 12 levels... from C:/apps/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load' from C:/apps/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 from C:/apps/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each' from C:/apps/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 rake aborted!
As far as I know 'test-unit' gem is only for ruby19 because in Ruby 1.9 Test::Unit support was extracted from Ruby core.
C:/apps/ruby18/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant Test::Unit::UI::SILENT (NameError) from C:/apps/ruby18/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing' from C:/apps/ruby18/lib/ruby/1.8/test/unit/autorunner.rb:47 from C:/apps/ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
It isn't clear for me because "Test::Unit::UI::SILENT" should be defined in C:/apps/ruby18/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:11 and second line of autorunner.rb is
Turns out, this is ALL Test:Units fault. I ended up with Test:Unit 2.0 for some reason (dependency) and Rails 2.3.x does not like that. I downgraded Test:Unit to 1.2.3, and the Test Runner GUI works like a champ, as well as no errors when running from command line.
I had to downgrade a few win32-* gems for other projects, but this is resolved.
Please attach full console output
Console output:
C:\Ruby\bin\ruby.exe -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) C:\Ruby\bin/rake test:units --trace
Testing started at 7:00 AM ...
(in C:/1Source/RailsAudit)
** Invoke test:units (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
** Execute db:test:load
** Invoke db:schema:load (first_time)
** Invoke environment
** Execute db:schema:load
** Execute test:units
C:/Ruby/bin/ruby.exe -I"lib;test" "C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/unit/app_setting_test.rb" "test/unit/audit_combine_test.rb" "test/unit/audit_mailer_test.rb" "test/unit/audit_test.rb" "test/unit/audit_user_test.rb" "test/unit/breadcrumb_test.rb" "test/unit/bug_comment_test.rb" "test/unit/bug_mailer_test.rb" "test/unit/bug_remediation_test.rb" "test/unit/bug_test.rb" "test/unit/chart_test.rb" "test/unit/dump_notes_audit_test.rb" "test/unit/duplicate_test.rb" "test/unit/history_test.rb" "test/unit/ldap_test.rb" "test/unit/metric_test.rb" "test/unit/product_test.rb" "test/unit/rake_mailer_test.rb" "test/unit/system_message_test.rb" "test/unit/track_history_test.rb" "test/unit/user_role_test.rb" "test/unit/user_test.rb" "test/unit/vuln_category_test.rb"
Loaded suite C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
...............................................................................
......................
Finished in 4.968 seconds.
101 tests, 224 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
Loaded suite C:\Ruby\bin/rake
Started
Finished in 0.0 seconds.
0 tests, 0 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
0% passed
Empty test suite.
Process finished with exit code 0
Probably "Test::Unit" framework formatter ins't attached in run configuration settings. Please add screenshot of "test:units" run configuration. See RM | Run | Edit Configurations.. dialog
Sorry for the delay, bit of vacation ...
Not sure if it is pertinent, but this (and all my other) rails projects were created pre Rubymine and none were actually created by rubymine.
Attachment(s):
rm_run_config.png
Does it matter if i inherit my testcases from ActiveSupport::TestCase instead of Test::Unit::TestCase ?
RubyMine should work in this case. You are using 1.8.6 (not 1.9) Ruby SDK, right?
1. Please show list of your gems ("gem list >> log.txt" command in console). Probably some of your gems conflicts with RubyMine's Test::Unit tests runner.
2. Create new "Empty" project in RubyMine, create any simple test unit test and launch it from context menu
Yes, ruby 1.8.
ok if I create a new project, and a simple test with a failing and passing method, everything works fine.
My old projects still nothing.
here is the gem list
Attachment(s):
gemlist.txt.zip
Any ideas on why existing projects dont work but new ones do?
I had a similar problem when we had "test/unit" specified as a dependency for our (rails) project.
And wich gems are "attached" in RubyMine settings?
Well it didnt fix it, but shows a new error now. If I remove test:unit from environment.rb I get 'uninitialized constant Test::Unit::UI::SILENT (NameError)'
C:/apps/ruby18/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant Test::Unit::UI::SILENT (NameError)
from C:/apps/ruby18/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in `const_missing'
from C:/apps/ruby18/lib/ruby/1.8/test/unit/autorunner.rb:47
from C:/apps/ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from C:/apps/ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from C:/apps/ruby18/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:158:in `require'
from C:\Program Files (x86)\JetBrains\RubyMine 2.0.1\rb\testing\patch\testunit/test/unit/autorunner.rb:47
from C:/apps/ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from C:/apps/ruby18/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
... 12 levels...
from C:/apps/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load'
from C:/apps/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
from C:/apps/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each'
from C:/apps/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
rake aborted!
in my environment.rb, I require have the following:
config.gem 'test-unit', :lib => 'test/unit'
config.gem "pdf-writer", :lib => 'pdf/writer',:version => '>= 1.1.8'
config.gem "ruby-net-ldap",:lib => 'net/ldap' ,:version => '>= 0.0.4'
config.gem "RedCloth",:version => '>= 4.1.1'
config.gem 'will_paginate',:version=>'>= 2.3.8',:source => 'http://gemcutter.org'
config.gem 'gchartrb',:lib=>'google_chart',:version =>'>= 0.8'
the project.iml shows:
<orderEntry type="library" name="[gem] rack (v1.0.1, C:/apps/ruby18/lib/ruby/gems/1.8/gems/rack-1.0.1)" level="application" />
<orderEntry type="library" name="[gem] color (v1.4.0, C:/apps/ruby18/lib/ruby/gems/1.8/gems/color-1.4.0)" level="application" />
<orderEntry type="library" name="[gem] gchartrb (v0.8, C:/apps/ruby18/lib/ruby/gems/1.8/gems/gchartrb-0.8)" level="application" />
<orderEntry type="library" name="[gem] pdf-writer (v1.1.8, C:/apps/ruby18/lib/ruby/gems/1.8/gems/pdf-writer-1.1.8)" level="application" />
<orderEntry type="library" name="[gem] ruby-net-ldap (v0.0.4, C:/apps/ruby18/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4)" level="application" />
<orderEntry type="library" name="[gem] transaction-simple (v1.4.0, C:/apps/ruby18/lib/ruby/gems/1.8/gems/transaction-simple-1.4.0)" level="application" />
<orderEntry type="library" name="[gem] RedCloth (v4.2.2, C:/apps/ruby18/lib/ruby/gems/1.8/gems/RedCloth-4.2.2)" level="application" />
<orderEntry type="library" name="[gem] mysql (v2.8.1, C:/apps/ruby18/lib/ruby/gems/1.8/gems/mysql-2.8.1-x86-mingw32)" level="application" />
<orderEntry type="library" name="[gem] mocha (v0.9.8, C:/apps/ruby18/lib/ruby/gems/1.8/gems/mocha-0.9.8)" level="application" />
<orderEntry type="library" name="[gem] actionpack (v2.3.5, C:/apps/ruby18/lib/ruby/gems/1.8/gems/actionpack-2.3.5)" level="application" />
<orderEntry type="library" name="[gem] rails (v2.3.5, C:/apps/ruby18/lib/ruby/gems/1.8/gems/rails-2.3.5)" level="application" />
<orderEntry type="library" name="[gem] activerecord (v2.3.5, C:/apps/ruby18/lib/ruby/gems/1.8/gems/activerecord-2.3.5)" level="application" />
<orderEntry type="library" name="[gem] activeresource (v2.3.5, C:/apps/ruby18/lib/ruby/gems/1.8/gems/activeresource-2.3.5)" level="application" />
<orderEntry type="library" name="[gem] activesupport (v2.3.5, C:/apps/ruby18/lib/ruby/gems/1.8/gems/activesupport-2.3.5)" level="application" />
<orderEntry type="library" name="[gem] rake (v0.8.7, C:/apps/ruby18/lib/ruby/gems/1.8/gems/rake-0.8.7)" level="application" />
<orderEntry type="library" name="[gem] actionmailer (v2.3.5, C:/apps/ruby18/lib/ruby/gems/1.8/gems/actionmailer-2.3.5)" level="application" />
<orderEntry type="library" name="[gem] will_paginate (v2.3.11, C:/apps/ruby18/lib/ruby/gems/1.8/gems/will_paginate-2.3.11)" level="application" />
<orderEntry type="library" name="[gem] cucumber (v0.4.4, C:/apps/ruby18/lib/ruby/gems/1.8/gems/cucumber-0.4.4)" level="application" />
As far as I know 'test-unit' gem is only for ruby19 because in Ruby 1.9 Test::Unit support was extracted from Ruby core.
It isn't clear for me because "Test::Unit::UI::SILENT" should be defined in C:/apps/ruby18/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:11 and second line of autorunner.rb is
Turns out, this is ALL Test:Units fault. I ended up with Test:Unit 2.0 for some reason (dependency) and Rails 2.3.x does not like that. I downgraded Test:Unit to 1.2.3, and the Test Runner GUI works like a champ, as well as no errors when running from command line.
I had to downgrade a few win32-* gems for other projects, but this is resolved.
Thanks for the help
It is great =)
Hi,
I was wrong, test-unit gem also supports Ruby 1.8.6. We've already fix this in RubyMine and fix will be available in RubyMine 2.0.2