<% case testing_framework %>
<% when :rspec %>
require 'rspec/core'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:<%= test_task %>) do |<%= test_task %>|
  <%= test_task %>.pattern = FileList['<%= test_pattern %>']
end
<% when :micronaut %>
require 'micronaut/rake_task'
Micronaut::RakeTask.new(:<%= test_task %>) do |<%= test_task %>|
  <%= test_task %>.pattern = '<%= test_pattern %>'
  <%= test_task %>.ruby_opts << '-Ilib -I<%= test_dir %>'
end
<% when :shindo %>
require 'shindo/rake'
Shindo::Rake.new
<% else %>
require 'rake/testtask'
Rake::TestTask.new(:<%= test_task %>) do |<%= test_task %>|
  <%= test_task %>.libs << 'lib' << '<%= test_dir %>'
  <%= test_task %>.pattern = '<%= test_pattern %>'
  <%= test_task %>.verbose = true
end
<% end %>

desc "Code coverage detail"
task :simplecov do
  ENV['COVERAGE'] = "true"
  Rake::Task['<%= test_task %>'].execute
end

<% if should_use_cucumber %>
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features)
<% end %>

<% if should_use_reek %>
require 'reek/rake/task'
Reek::Rake::Task.new do |t|
  t.fail_on_error = true
  t.verbose = false
  t.source_files = 'lib/**/*.rb'
end
<% end %>

<% if should_use_roodi %>
require 'roodi'
require 'roodi_task'
RoodiTask.new do |t|
  t.verbose = false
end
<% end %>

task :default => :<%= default_task %>

<% case documentation_framework %>
<% when :rdoc %>
require 'rdoc/task'
Rake::RDocTask.new do |rdoc|
  version = File.exist?('VERSION') ? File.read('VERSION') : ""

  rdoc.rdoc_dir = 'rdoc'
  rdoc.title = "<%= project_name %> #{version}"
  rdoc.rdoc_files.include('README*')
  rdoc.rdoc_files.include('lib/**/*.rb')
end
<% when :yard %>
require 'yard'
YARD::Rake::YardocTask.new
<% end %>
