2010-09-17 23:56:32 +00:00
|
|
|
require 'rubygems'
|
2010-09-18 00:23:13 +00:00
|
|
|
require 'rspec/core/rake_task'
|
2012-01-26 13:58:25 +00:00
|
|
|
require 'cucumber/rake/task'
|
2010-09-17 23:56:32 +00:00
|
|
|
require 'yard'
|
|
|
|
|
|
|
|
desc "Run all examples"
|
2010-11-21 13:37:36 +00:00
|
|
|
RSpec::Core::RakeTask.new(:spec) do |t|
|
|
|
|
t.rspec_opts = %w[--color]
|
2016-09-01 22:46:56 +00:00
|
|
|
# When we drop RSpec 2.x support we can rename spec_chrome.rb and implement this properly
|
|
|
|
# t.exclude_pattern = './spec/*{_chrome_spec.rb}'
|
2010-11-21 13:37:36 +00:00
|
|
|
end
|
2014-03-31 22:10:27 +00:00
|
|
|
|
2016-09-01 22:46:56 +00:00
|
|
|
RSpec::Core::RakeTask.new(:all) do |t|
|
2013-02-25 19:13:03 +00:00
|
|
|
t.rspec_opts = %w[--color]
|
2014-03-31 22:10:27 +00:00
|
|
|
# jruby buffers the progress formatter so travis doesn't see output often enough
|
2013-11-19 21:53:06 +00:00
|
|
|
t.rspec_opts << '--format documentation' if RUBY_PLATFORM=='java'
|
2013-02-25 19:13:03 +00:00
|
|
|
t.pattern = './spec{,/*/**}/*{_spec.rb,_spec_chrome.rb}'
|
|
|
|
end
|
2010-09-17 23:56:32 +00:00
|
|
|
|
2015-05-21 18:00:36 +00:00
|
|
|
RSpec::Core::RakeTask.new(:spec_chrome) do |t|
|
|
|
|
t.rspec_opts = %w[--color]
|
|
|
|
# jruby buffers the progress formatter so travis doesn't see output often enough
|
|
|
|
t.rspec_opts << '--format documentation' if RUBY_PLATFORM=='java'
|
|
|
|
t.pattern = './spec/*{_spec_chrome.rb}'
|
|
|
|
end
|
|
|
|
|
2010-09-17 23:56:32 +00:00
|
|
|
YARD::Rake::YardocTask.new do |t|
|
2012-01-06 18:15:33 +00:00
|
|
|
t.files = ['lib/**/*.rb']
|
2014-04-03 07:57:31 +00:00
|
|
|
t.options = %w(--markup=markdown)
|
2010-09-17 23:56:32 +00:00
|
|
|
end
|
|
|
|
|
2012-01-26 13:58:25 +00:00
|
|
|
Cucumber::Rake::Task.new(:cucumber) do |task|
|
|
|
|
task.cucumber_opts = ['--format=progress', 'features']
|
|
|
|
end
|
|
|
|
|
2015-05-21 18:00:36 +00:00
|
|
|
task :travis do |t|
|
|
|
|
if ENV['CAPYBARA_CHROME']
|
|
|
|
Rake::Task[:spec_chrome].invoke
|
|
|
|
else
|
|
|
|
Rake::Task[:spec].invoke
|
|
|
|
Rake::Task[:cucumber].invoke
|
|
|
|
end
|
|
|
|
end
|
2013-02-25 19:13:03 +00:00
|
|
|
|
2012-01-26 13:58:25 +00:00
|
|
|
task :default => [:spec, :cucumber]
|