forked from activerecord-hackery/ransack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
45 lines (39 loc) · 1.14 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
require 'bundler'
require 'rspec/core/rake_task'
Bundler::GemHelper.install_tasks
RSpec::Core::RakeTask.new(:spec) do |rspec|
ENV['SPEC'] = 'spec/ransack/**/*_spec.rb'
# 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']
end
RSpec::Core::RakeTask.new(:mongoid) do |rspec|
ENV['SPEC'] = 'spec/mongoid/**/*_spec.rb'
rspec.rspec_opts = ['--backtrace']
end
task :default do
if ENV['DB'] =~ /mongoid/
Rake::Task["mongoid"].invoke
else
Rake::Task["spec"].invoke
end
end
desc "Open an irb session with Ransack and the sample data used in specs"
task :console do
require 'pry'
require File.expand_path('../spec/console.rb', __FILE__)
ARGV.clear
Pry.start
end
desc "Open an irb session with Ransack, Mongoid and the sample data used in specs"
task :mongoid_console do
require 'irb'
require 'irb/completion'
require 'pry'
require 'mongoid'
require File.expand_path('../lib/ransack.rb', __FILE__)
require File.expand_path('../spec/mongoid/support/schema.rb', __FILE__)
ARGV.clear
Pry.start
end