This repository has been archived by the owner on Dec 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathRakefile
executable file
·72 lines (60 loc) · 1.47 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env rake
require 'rubygems'
require 'bundler'
Bundler.require(:default)
require 'rake'
require 'rake/testtask'
require 'bundler/gem_tasks'
require 'appraisal'
require 'rspec/core/rake_task'
begin
require 'cucumber/rake/task'
rescue LoadError
$stderr.puts "Please install cucumber: `gem install cucumber`"
exit 1
end
#########################################
### TESTS
#########################################
desc 'Default: run tests'
task :default => [:spec, "mongodb_logger:tests"]
namespace :mongodb_logger do
task :tests do
exec 'rake appraisal cucumber '\
'&& FEATURE=features/mongodb_logger_web.feature rake cucumber '\
end
end
desc "run specs"
task :spec do
RSpec::Core::RakeTask.new
end
desc "Clean out the tmp directory"
task :clean do
exec "rm -rf tmp/*"
end
desc 'Test unit'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib'
test.test_files = ['test/unit/mongodb_logger_test.rb']
test.verbose = true
end
namespace :test do
desc "Run replica set tests (not for CI)"
Rake::TestTask.new(:replica_set) do |test|
test.libs << 'lib'
test.pattern = 'test/unit/mongodb_logger_replica_test.rb'
test.verbose = true
end
end
def cucumber_opts
opts = "--tags ~@wip --format progress "
opts << ENV["FEATURE"] and return if ENV["FEATURE"]
case ENV["BUNDLE_GEMFILE"]
when /rails/
opts << "features/rails.feature"
end
end
Cucumber::Rake::Task.new(:cucumber) do |t|
t.fork = true
t.cucumber_opts = cucumber_opts
end