method_source
method_source copied to clipboard
Require paths in test.rb should be expanded
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.
why aren't you just using rake test to run tests?
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.
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
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.
Ah ok, no problem. Send me a pull request and i'll apply it ;)
Thanks