[rspec-devel] [ rspec-Patches-10574 ] Pre_commit refactoring

noreply at rubyforge.org noreply at rubyforge.org
Thu May 10 11:24:31 EDT 2007

Patches item #10574, was opened at 2007-05-04 18:25
You can respond by visiting: 

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Antti Tarvainen (tarvaina)
Assigned to: Nobody (None)
Summary: Pre_commit refactoring

Initial Comment:
Here's a refactoring of the rails plugin part of the pre_commit code. Since it's a lot of code, you might want to try it out for a couple of days before you decide if it should be committed to the trunk.

The code is fully specced, but the specs don't run as part of the pre_commit procedure yet. To run them, run rake in new_pre_commit directory.

I tried to change the functionality as little as possible. However, a few things did change. Most notably:

* The output is a little different.
* The current Rails edge succeeds on the old pre_commit, but fails on the new one. The new pre_commit doesn't tolerate the config.breakpoint_server deprecation warning. The old pre_commit tries to guess from the script/generate output, which lines are errors and which are not. The new pre_commit uses script/generate --quiet and assumes any output is an error message.

Other things:

* The code still uses SVN export and revert, so pre_commit fails if you try to run it on svn-exported code rather than svn-checked-out.
* I have only run the code on Mac. If someone wants to test it on Windows, that would be great. You will probably need the win32-popen.gem to run it, though.

I probably won't have any time next week, but I plan to refactor the rest of the pre_commit code the week after. If someone else wants to do it before that, that's fine also.


>Comment By: Antti Tarvainen (tarvaina)
Date: 2007-05-10 18:24

The purpose is to add specs to it so that we know that we
don't break it when we change it. In the original form, it
was too complicated to spec in a reasonable manner.

For an example of the type of problems that can go unnoticed
without specs, see patch 10315.


In my opinion, although it is "just" the build code it
should not be left unspecced.


Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-05-10 16:35

What's the purpose of this refactoring?


Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-05-04 18:37

Just a quick heads up before I look at this. I just removed the call to config.breakpoint_server, so that shouldn't be an issue any more.


You can respond by visiting: 

More information about the rspec-devel mailing list