I use both the following commands to run tests in my application:
ruby -Ilib test/unit/account_test.rb
ruby -Itest test/unit/account_test.rb
Both works fine. But, what is the difference. What actually the flag -I means?
From the Ruby manual page (man ruby):
-I directory Used to tell Ruby where to load the library scripts. Direc‐
tory path will be added to the load-path variable ($:).
The variable $: (aliased as $LOAD_PATH) is the array of directories where Ruby looks for files to load when you call require. In your case both commands works well because, I guess, you don't require anything inside lib or test directories from your test code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With