forked from laserlemon/periscope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
33 lines (26 loc) · 915 Bytes
/
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
require "bundler/gem_helper"
require "rspec/core/rake_task"
Bundler::GemHelper.install_tasks(name: "periscope")
Bundler::GemHelper.install_tasks(name: "periscope-activerecord")
Bundler::GemHelper.install_tasks(name: "periscope-mongo_mapper")
Bundler::GemHelper.install_tasks(name: "periscope-mongoid")
Bundler::GemHelper.install_tasks(name: "periscope-data_mapper")
ADAPTERS = %w(active_record data_mapper mongo_mapper mongoid)
ADAPTERS.each do |adapter|
desc "Run RSpec code examples for #{adapter} adapter"
RSpec::Core::RakeTask.new(adapter => "#{adapter}:adapter") do |t|
t.pattern = "spec/periscope/adapters/#{adapter}_spec.rb"
end
namespace adapter do
task :adapter do
ENV["ADAPTER"] = adapter
end
end
end
RSpec::Core::RakeTask.new(spec: ADAPTERS + [:adapter]) do |t|
t.pattern = "spec/periscope_spec.rb"
end
task :adapter do
ENV["ADAPTER"] = nil
end
task default: :spec