method_source icon indicating copy to clipboard operation
method_source copied to clipboard

Require paths in test.rb should be expanded

Open voxik opened this issue 13 years ago • 5 comments

In Ruby 1.9.3, there is no '.' in file search path, therefore the test suite needs to be executed by:

$ bacon -I. test/test.rb

But I consider the '-I.' superfluous and the correct approach should be to use the File.expand_path to obtain full path to require paths, e.g. the following command will do the change:

$ sed -i 's|direc = File.dirname(__FILE__)|direc = File.expand_path(File.dirname(__FILE__))|' test/test.rb

Thank you for consideration.

voxik avatar May 02 '12 14:05 voxik

why aren't you just using rake test to run tests?

banister avatar May 02 '12 14:05 banister

I am not using Rake, since Rake is additional dependency and moreover it has tendency to bring in even more unnecessary dependencies, such as Hoe, etc.

voxik avatar May 02 '12 19:05 voxik

You're going to have a very hard time not using Rake, as almost every single ruby project uses it in one way or another ;)

Anyway, rake is defined as a developer dependency in the method_source gemspec, see here: https://github.com/banister/method_source/blob/master/method_source.gemspec#L24

banister avatar May 03 '12 02:05 banister

I have nothing against using Rake for development purposes, but I am not running the test suite because I am developing. I am running the test suite, because I am packaging your gem for Fedora. I am not asking you to remove Rake, I just would like to improve your code versatility.

Btw not using Rake is pretty fine. I am maintaining more the 80 gems for Fedora and with few exceptions, you could count on one hand, I am pretty successful to execute the test suite not using Rake.

voxik avatar May 03 '12 05:05 voxik

Ah ok, no problem. Send me a pull request and i'll apply it ;)

Thanks

banister avatar May 03 '12 05:05 banister