Skip to content

Instantly share code, notes, and snippets.

@seanbehan
Created January 18, 2012 21:36
Show Gist options
  • Select an option

  • Save seanbehan/1635859 to your computer and use it in GitHub Desktop.

Select an option

Save seanbehan/1635859 to your computer and use it in GitHub Desktop.
How to add an arbitrary directory to your tests/ directory
# Edit Rakefile in project root
#
# Add a new rake test task... E.g., rake test:lib, below everything else in that file...
# Alternatively, add a task in lib/tasks/ directory and plop in the same code
namespace :test do
desc "Test lib source"
Rake::TestTask.new(:lib) do |t|
t.libs << "test"
t.pattern = 'test/lib/**/*_test.rb'
t.verbose = true
end
end
lib_task = Rake::Task["test:lib"]
test_task = Rake::Task[:test]
test_task.enhance { lib_task.invoke }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment