Skip to content

Instantly share code, notes, and snippets.

View zporter's full-sized avatar
👨‍💻

Zach Porter zporter

👨‍💻
View GitHub Profile
if defined?(RSpec)
namespace :rcov do
RSpec::Core::RakeTask.new(:rspec_aggregate) do |task|
task.pattern = 'spec/**/*_spec.rb'
task.rspec_opts = "--format progress"
task.rcov = true
task.rcov_opts = "--rails --exclude osx\/objc,spec,gems\/ " +
"--aggregate tmp/coverage.data"
end
@Burgestrand
Burgestrand / render.rake
Created September 23, 2010 00:27
How to render Rails 3.0 views within rake tasks (with url helpers!)
# How to render rails 3.0 views within rake tasks.
#
# Description: An example of how to render a view within a rake task,
# complete with instance variables, application & url helpers and I18n.
#
# License: X11 license
#
# Copyright (c) 2010 Kim Burgestrand <http://burgestrand.se/>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy