forked from thoughtbot/trail-map
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
31 lines (24 loc) · 802 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
require 'rake'
require 'bundler/setup'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
task :environment do
script_directory = File.dirname(__FILE__)
helper_files = script_directory + '/lib/helpers/*.rb'
Dir[helper_files].each { |file| require File.expand_path(file) }
end
desc 'Run RSpec code examples and validations'
task :test => [:spec, :validate]
desc 'Run validations'
task :validate => %w(validate:json validate:uris)
namespace :validate do
desc 'Run JSON validations'
task :json => :environment do
TrailRunner.new.run('JSON validation') { |file| JSONValidator.new(file).run }
end
desc 'Run URI validations'
task :uris => :environment do
TrailRunner.new.run('URI validation') { |file| URIValidator.new(file).run }
end
end
task :default => :test