| Summary: | RSpec runner broken if RSpec 2.0.0 installed | ||
|---|---|---|---|
| Product: | [Technology] DLTK | Reporter: | John-Mason P. Shackelford <jpshack> |
| Component: | Ruby | Assignee: | dltk.ruby-inbox <dltk.ruby-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | akurtakov, alex.panchenko, cagatayk, dchelimsky, tiefox |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
John-Mason P. Shackelford
RSpec-2's architecture supports extensions through hooks and mixins rather than subclassing or monkey patching RSpec's internals. The good news is that future RSpec releases will be able to support backward compatibility to RSpec-2 without being bound to structure. The bad news is that RSpec-2's structure has changed quite radically from RSpec-1, so extensions like that in dltk-rspec-runner.rb are not compatible with RSpec-2. To resolve this issue, we'll need to figure out a way to identify the version of RSpec that an Eclipse user wants to use in each project, and then load the appropriate hooks based on that choice. I am not an eclipse user myself, so I don't know how this would work from a UX perspective or internally, but I am more than happy to work with you to ensure that the RSpec-2 support is using documented APIs that won't break compatibility in future releases. I'm also happy to establish new APIs if there are things RSpec-2 can do to make this sort of extension easier. Sound like a plan? By inserting lines as below into dltk-rspec-runner.rb, I get past the problem with the install of 2.0.0.beta breaking runner for 1.6.0. Seem that while the first require was throwing LoadError, it had still activated the rspec-2 gem so that rspec-1 could not be activated below. (I had previously tried to activate the 1.6.0 gem in the rescue block but 2.0.0 had already been activated.) + # -- Hack -- + require 'rubygems' + gem 'rspec', '1.3.0' + require 'spec' + # ----------- require 'socket' begin # ssanders: Try to load RSpec based on the LOADPATH, this allows # projects (e.g. Rails) to provide alternate versions via the buildpath require 'spec' rescue LoadError # ssanders: Fallback to loading from the Gem require 'rubygems' gem 'rspec' require 'spec' end In Response to David Chelimsky's comment, I believe DLTK-Ruby already has the concept of a selectable testing engine in the UI. It currently has engines for Test::Unit and RSpec-1, so if we can find a better approach to fixing the problem with inadvertently loading the beta GEM in the current runner, we could just add a seperate RSpec runner for RSpec-2. Hi all, I have some questions regarding this issue: 1. Is rspec-2 compatible with rspec-1? I want to understand if it makes sense for the user to select the correct version of the runner manually, or should we use the greatest version installed and automatically run the correct code? 2. Regarding the workaround Do you think it will work in the following way: gem 'rspec', '< 2.0' Regards, Alex (In reply to comment #3) > 1. Is rspec-2 compatible with rspec-1? From what David comment above: "The bad news is that RSpec-2's structure has changed quite radically from RSpec-1, so extensions like that in dltk-rspec-runner.rb are not compatible with RSpec-2." So I think that is not compatible. Ruby support has been removed. |