2011-03-30 20:31:39 -04:00
|
|
|
require 'bundler'
|
|
|
|
require 'rspec/core/rake_task'
|
|
|
|
|
|
|
|
Bundler::GemHelper.install_tasks
|
|
|
|
|
|
|
|
RSpec::Core::RakeTask.new(:spec) do |rspec|
|
2014-08-01 05:04:54 -04:00
|
|
|
ENV['SPEC'] = 'spec/ransack/**/*_spec.rb'
|
2015-08-30 14:05:45 -04:00
|
|
|
# With Rails 3, using `--backtrace` raises 'invalid option' when testing.
|
|
|
|
# With Rails 4 and 5 it can be uncommented to see the backtrace:
|
|
|
|
#
|
|
|
|
# rspec.rspec_opts = ['--backtrace']
|
2014-08-01 05:04:54 -04:00
|
|
|
end
|
|
|
|
|
2014-08-04 01:48:13 -04:00
|
|
|
task :default do
|
2018-06-25 14:50:14 -04:00
|
|
|
Rake::Task["spec"].invoke
|
2014-08-04 01:48:13 -04:00
|
|
|
end
|
2011-03-30 20:31:39 -04:00
|
|
|
|
|
|
|
desc "Open an irb session with Ransack and the sample data used in specs"
|
|
|
|
task :console do
|
2016-07-23 22:21:36 -04:00
|
|
|
require 'pry'
|
2016-07-23 21:34:59 -04:00
|
|
|
require File.expand_path('../spec/console.rb', __FILE__)
|
2011-03-30 20:31:39 -04:00
|
|
|
ARGV.clear
|
2016-07-23 21:34:59 -04:00
|
|
|
Pry.start
|
2014-11-02 14:14:12 -05:00
|
|
|
end
|