[rspec-devel] [ rspec-Patches-12986 ] Autotest Specs + Refactoring

noreply at rubyforge.org noreply at rubyforge.org
Mon Aug 13 01:16:16 EDT 2007


Patches item #12986, was opened at 2007-08-11 00:05
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3151&aid=12986&group_id=797

Category: None
Group: None
Status: Closed
Resolution: Accepted
Priority: 3
Submitted By: Scott Taylor (smtlaissezfaire)
Assigned to: David Chelimsky (dchelimsky)
Summary: Autotest Specs + Refactoring

Initial Comment:

David,

I've finally finished the Autotest specs.  I had to do some refactoring to spec it out.


----------------------------------------------------------------------

>Comment By: David Chelimsky (dchelimsky)
Date: 2007-08-13 05:16

Message:
Hey Scott - I already fixed this bug in r2331 (see http://rubyforge.org/tracker/?func=detail&group_id=797&aid=13015&atid=3149). "script/spec" is specific to rspec_on_rails, so it gets handled in rails_rspec.rb (in the rspec_on_rails plugin) rather than core.

The only open issue is related to the original issue, which is that if there is no rspec gem installed, you can't run autotest against a non-rails project (including rspec itself).

----------------------------------------------------------------------

Comment By: Scott Taylor (smtlaissezfaire)
Date: 2007-08-13 05:01

Message:
Okay - I'm attaching a patch for the second, more important bug.


----------------------------------------------------------------------

Comment By: Scott Taylor (smtlaissezfaire)
Date: 2007-08-13 00:32

Message:
So - two bugs:

1. The first documented before.  The fix actually doesn't
work, for two reasons:

a) It should work under Unix/POSIX, but it doesn't look like
applying the patch worked.  The symbolic link which points
vendor/plugins/rspec => rspec isn't there when I check out
trunk (actually no vendor dir is checked out at all)

b) Symbolic links won't work on Windows w/ subversion (see:
http://subversion.tigris.org/)

2. The second bug is the *IMPORTANT* one.  It is the one
which effects end users of Rspec, not developers of Rspec. 
That bug was reported in #13015.  

(I believe) the second bug occurs with the following setup:  

* No rspec gem installed
* a rails project (or other project) with rspec checked out
into vendor/plugins.  When autotest is run, it searches for
spec commands in bin/spec as well as the gem dirs.  Neither
is found (since bin/spec doesn't exist, and rspec's gem
isn't installed).  It then raises an error.  This bug fix
should be as easy as adding script/spec to the list of spec
commands in Autotest::Rspec#spec_commands.



----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-08-12 23:08

Message:
Too late - already released 1.0.7.

What's the other bug?

----------------------------------------------------------------------

Comment By: Scott Taylor (smtlaissezfaire)
Date: 2007-08-12 23:05

Message:
Two bugs here.  Don't release 1.0.7 yet.  I'll post another
bug fix in a few moments.



----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-08-12 22:39

Message:
Fixed in r2331. 1.0.7 coming soon.

----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-08-12 22:31

Message:
"Luckily, this is only a bug which affects development of
RSpec itself, with the addition stipulation that the rspec
gem isn't installed.  Any other project will either assume
rspec is installed, or it will have rspec on externals in
vendor/plugins."

Actually - it also means that rspec/rails users can't use rspec/rails/autotest together without installing the rspec gem. So this is a regression.

I've got a fix in the works and will commit shortly.

----------------------------------------------------------------------

Comment By: Scott Taylor (smtlaissezfaire)
Date: 2007-08-12 22:00

Message:

Yes, it does break down, and it is for the following reason:

When the command line Autotest is run, it adds
vendor/plugins/**/lib unto the load path, as well as the
various gems, and then searches the loadpath for
autotest/discover.rb.  

So if RSpec 1.0.6 isn't installed, Autotest will not run at
all in rspec/.

Luckily, this is only a bug which affects development of
RSpec itself, with the addition stipulation that the rspec
gem isn't installed.  Any other project will either assume
rspec is installed, or it will have rspec on externals in
vendor/plugins.

I don't think this warrants an emergency 1.0.7 release.


A solution:
I've added a vendor/plugins/rspec symbolic link which links
back to rspec/.  Autotest runs just fine now without the
rspec gem.  

Unfortunately a cleaner solution doesn't seem available or
apparent to me without modifying autotest itself. (I'll look
into doing this in the future)


----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-08-12 15:05

Message:
Scott - unfortunately, this breaks down if you don't have the rspec gem installed.

I have to head out for the day so I can't fix this until tonight. If you happen to see this and have time today, it would rock if you would uninstall your rspec gem and get this to work and submit a new patch (against the current trunk).

If you can do that I'll apply tonight. If not, I'll fix it myself. Unfortunately, I released this and need to do a follow up release that works as soon as possible.

Thanks,
David

----------------------------------------------------------------------

Comment By: David Chelimsky (dchelimsky)
Date: 2007-08-11 03:11

Message:
Applied to r2326.

Excellent patch.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3151&aid=12986&group_id=797


More information about the rspec-devel mailing list