Right now, I'm using bundler to manage my gems. Bundler loads different gems for different environments.
I have some rake tasks that use testing gems (rspec), but these cause problems in production environments where that gem isn't loaded.
So what I'd like to be able to do is to only have the rake task (and the require 'rspec/core/rake_task' line associated with it) load in the test environment.
I can't quite figure out the best way to do this.
I currently have:
require "bundler"
require 'rspec/core/rake_task'
desc "Task for running Rspec tests"
RSpec::Rake::SpecTask.new(:spec)