Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323736 - Unit Test Runner is not working with test-unit-2.1.1
Summary: Unit Test Runner is not working with test-unit-2.1.1
Status: RESOLVED FIXED
Alias: None
Product: DLTK
Classification: Technology
Component: Ruby (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major with 2 votes (vote)
Target Milestone: 5.5   Edit
Assignee: dltk.ruby-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-26 13:57 EDT by Lars Benner CLA
Modified: 2016-03-21 09:54 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Benner CLA 2010-08-26 13:57:09 EDT
Build Identifier: 20100618-0524

After installing Ruby 1.9.2 and setting it as interpreter I was not able to run unit test anymore within Eclipse. From some research on the internet I learned that Ruby 1.9 has changed the default UnitTest library to minitest. 

To get my unit test running again I installed the test-unit gem (test-unit-2.1.1), the library normally shipped with Ruby. 

Then I tried to run a unit test and got the following error:

eclipse/configuration/org.eclipse.osgi/bundles/416/1/.cp/testing/dltk-testunit-runner.rb:252:in `block in <top (required)>': uninitialized constant Test::Unit::UI::SILENT (NameError)

After some searching in the dltk-testunit-runner.rb file and several Test::Unit files I figured out that I have to replace line 252 in the dltk-testunit-runner.rb file with this line:

autoRunner.runner_options[:output_level] = Test::Unit::UI::Console::OutputLevel::SILENT

After this change, I can run my tests again in Eclipse. I believe the tricky part will be to decide which test-unit version is installed to use the correct way to configure the silent mode. 


DLTK Version Installed:

Dynamic Languages Toolkit - Ruby Development Tools	2.0.0.v20100505-1154-7G--E_EkMU3NHhvAUo0G	org.eclipse.dltk.ruby.feature.group

Reproducible: Always

Steps to Reproduce:
1. Setup Eclipse with Ruby 1.9.2
2. Install the test-unit-2.1.1 gem 
3. Run a unit test
Comment 1 Frank Wagner CLA 2012-01-14 16:10:31 EST
A workaround is to mixin the missing symbols and methods


# compat mixin for Ruby 1.9.1 with test-unit gem in Eclipse
module Test
  module Unit
    module UI
      SILENT = false
    end

    class AutoRunner
      def output_level=(level)
        self.runner_options[:output_level] = level
      end
    end
  end
end
Comment 2 Lars Benner CLA 2015-11-09 16:00:24 EST
I committed to github.com a fix for this issue and created the merge request.

  https://github.com/eclipse/dltk.ruby/pull/2
Comment 3 Eclipse Genie CLA 2016-03-21 08:50:56 EDT
New Gerrit change created: https://git.eclipse.org/r/68897
Comment 5 Alexander Kurtakov CLA 2016-03-21 09:54:24 EDT
Fixed in master now.