[Patch]Autotest Broked on Mac
Reported by Tim Dysinger | April 29th, 2008 @ 05:43 AM | in 1.0 (Nearish Future)
In merb_spec.rb the spec_command search paths don't include /usr/bin/spec where spec lives. This means out of the box autospec merb doesn't work on the mac.
File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'spec'))
( This is /User/tim/Projects/bin/spec ??? )
File.join(Config::CONFIG['bindir'], 'spec')
( This is /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/spec where as
spec is actually /usr/bin/spec on my mac )
Fix is:
def spec_commands
[ File.join(Config::CONFIG['bindir'], 'spec'), 'spec' ]
end
And is pushed to my repo @ github:
To git@github.com:dysinger/merb-more.git @ master @ 3382e44825ed
Comments and changes to this ticket
-
Michael Klishin (antares) May 6th, 2008 @ 06:05 PM
Tim,
on my Mac which spec and CONFIG['bindir'] show different locations. Any thoughts?
-
Tim Dysinger May 1st, 2008 @ 11:51 PM
Michael,
That's the same behavior I got and I said that above
`which spec` = /usr/bin/spec
Config::CONFIG['bindir'] = /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin
I bet you have a broken app generator too then. Try generating an app and then going into it and typing autotest.
Of course you need rspec, merb from github and zentest.
-
Michael Klishin (antares) May 2nd, 2008 @ 12:12 AM
Tim,
merb-gen app autotest_test worked for me.
I've already applied [very similar patch](http://merb.lighthouseapp.com/pr...) that adds both config bindir and information from which output.
-
Michael D. Ivey (ivey) May 2nd, 2008 @ 12:18 AM
- → State changed from new to invalid
Dupe of 108, closing in favor of that one
-
Tim Dysinger May 2nd, 2008 @ 04:33 PM
Michael Klishin,
I have respectfully disagree that this patch is invalid. This patch's implicit-pathed spec_command default works.
By applying the patch on 108 which pulls a `which spec`.chomp you have just fixed it on mac and broke it on windows.
I don't really care about windows but the merb project might.
-Tim
-
Tim Dysinger May 2nd, 2008 @ 04:35 PM
I need to re-word that. It may not be broke out of the box on windows due to bindir might find spec in the right place. But if it ever gets to the `which spec` line it will break on windows.
-
Michael D. Ivey (ivey) May 2nd, 2008 @ 04:38 PM
- → State changed from invalid to open
Re-opening for discussion
-
Michael Klishin (antares) May 3rd, 2008 @ 02:37 AM
Yesh, I should have thought about which being a *nix-only thing. I think I'll combine your patches with a platform distinguishing condition.
Thanks for pointing out Tim!
-
Tim Dysinger May 3rd, 2008 @ 09:41 AM
Also I don't get this line
File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'spec'))
If I create a project in /User/tim/Projects/tstprj it looks for rspec in /User/tim/Projects/bin
Which says "look for the rspec command in the bin folder of the parent directory of this project" ??? Why would it look for rspec there?
That seems like a wasted check to me.
-
Tim Dysinger May 3rd, 2008 @ 09:43 AM
Anyway you got this ticket - I have spent way too much time on it. :)
-
Michael Klishin (antares) May 3rd, 2008 @ 08:29 PM
- → Milestone changed from to 1.0 (Nearish Future)
- → Assigned user changed from to Michael Klishin (antares)
-
Michael Klishin (antares) May 3rd, 2008 @ 08:35 PM
- → State changed from open to resolved
Patch did not apply after I (stupidly) applied the other one, but it is fixed and pushed. Thank you for comments, Tim!
-
Michael Klishin (antares) May 8th, 2008 @ 01:03 PM
- no changes were found...
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
