forked from seomoz/qless
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
29 lines (23 loc) · 886 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
#!/usr/bin/env rake
require 'bundler'
Bundler.setup
require "bundler/gem_tasks"
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = %w[--profile --format progress]
t.ruby_opts = "-Ispec -rsimplecov_setup"
end
# TODO: bump this up as test coverage increases. It was 90.29 when I last updated it on 2012-05-21.
# On travis where we skip JS tests, it's at 83.9 on 2013-01-15
min_coverage_threshold = 83.5
desc "Checks the spec coverage and fails if it is less than #{min_coverage_threshold}%"
task :check_coverage do
percent = File.read("./coverage/coverage_percent.txt").to_f
if percent < min_coverage_threshold
raise "Spec coverage was not high enough: #{percent.round(2)}%"
else
puts "Nice job! Spec coverage is still at least #{min_coverage_threshold}%"
end
end
task default: [:spec, :check_coverage]
require 'qless/tasks'