banister / method_source

return the sourcecode for a method
MIT License
361 stars 43 forks source link

Require paths in test.rb should be expanded #12

Open voxik opened 12 years ago

voxik commented 12 years ago

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.

banister commented 12 years ago

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

voxik commented 12 years ago

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.

banister commented 12 years ago

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

voxik commented 12 years ago

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.

banister commented 12 years ago

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

Thanks