Permalink
Browse files

include lib folder if it exists

  • Loading branch information...
1 parent b3c23e0 commit 0a9b9256e6ae387dff62b8852088c7ea752bbedf @rsanheim committed Aug 24, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/watch-me-now.rb
View
@@ -5,6 +5,10 @@ def test_folder
@test_folder ||= %w[spec examples test].detect { |p| File.directory?(p) }
end
+def include_lib_folder_if_exists
+ "-Ilib" if File.directory?("lib")
+end
+
def test_suffix
case test_folder
when "spec" then "spec"
@@ -38,7 +42,7 @@ def run(files_to_run)
if files_to_run.strip.empty?
puts "No files to run"
else
- cmd = "#{runner} -I#{test_folder} #{files_to_run}"
+ cmd = "#{runner} #{include_lib_folder_if_exists} -I#{test_folder} #{files_to_run}"
execute cmd
end
no_int_for_you

0 comments on commit 0a9b925

Please sign in to comment.