-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathRakefile
48 lines (36 loc) · 968 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
34
35
36
37
38
39
40
41
42
43
44
45
require 'bundler/setup'
require 'bundler/gem_tasks'
require 'rake/testtask'
Rake::TestTask.new do |t|
t.test_files = FileList['test/*.rb']
t.verbose = true
end
begin
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:refinement) do |task|
task.rspec_opts = "--order rand"
task.pattern = "spec/refinement/*_spec.rb"
end
RSpec::Core::RakeTask.new(:monkeypatch) do |task|
task.rspec_opts = "--order rand"
task.pattern = "spec/monkeypatch/*_spec.rb"
end
RSpec::Core::RakeTask.new(:safe) do |task|
task.rspec_opts = "--order rand"
task.pattern = "spec/safe/*_spec.rb"
end
rescue LoadError
warn "rspec unavailable"
end
task :default do
Rake::Task["test"].invoke
Rake::Task["monkeypatch"].invoke
Rake::Task["safe"].invoke
Rake::Task["refinement"].invoke if ruby_major >= 2 && ruby_minor >= 1
end
def ruby_major
RUBY_VERSION.split(/\./)[0].to_i
end
def ruby_minor
RUBY_VERSION.split(/\./)[1].to_i
end