forked from composite-primary-keys/composite_primary_keys
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
37 lines (31 loc) · 1.06 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
require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require 'rubygems/package_task'
# Set global variable so other tasks can access them
::PROJECT_ROOT = File.expand_path(".")
::GEM_NAME = 'composite_primary_keys'
require File.join(PROJECT_ROOT, 'lib', 'composite_primary_keys')
require File.join(PROJECT_ROOT, 'test', 'connections', 'connection_spec')
# Read the spec file
spec = Gem::Specification.load("#{GEM_NAME}.gemspec")
# Setup Rake tasks for managing the gem
Gem::PackageTask.new(spec).define
# Now load in other task files
Dir.glob('tasks/**/*.rake').each do |rake_file|
load File.join(File.dirname(__FILE__), rake_file)
end
# Set up test tasks for each supported connection adapter
%w(mysql sqlite oracle oracle_enhanced postgresql ibm_db sqlserver).each do |adapter|
namespace adapter do
desc "Run tests using the #{adapter} adapter"
task "test" do
ENV["ADAPTER"] = adapter
Rake::TestTask.new("subtest_#{adapter}") do |t|
t.libs << "test"
end
Rake::Task["subtest_#{adapter}"].invoke
end
end
end