2018-04-18 13:45:35 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2010-09-17 18:56:32 -05:00
|
|
|
require 'rubygems'
|
2010-09-17 19:23:13 -05:00
|
|
|
require 'rspec/core/rake_task'
|
2012-01-26 14:58:25 +01:00
|
|
|
require 'cucumber/rake/task'
|
2010-09-17 18:56:32 -05:00
|
|
|
require 'yard'
|
|
|
|
|
2016-10-13 19:50:03 -07:00
|
|
|
desc "Run all examples with Firefox non-marionette"
|
2014-03-31 17:10:27 -05:00
|
|
|
|
2016-10-13 19:50:03 -07:00
|
|
|
RSpec::Core::RakeTask.new(:spec_marionette) do |t|
|
2013-02-25 11:13:03 -08:00
|
|
|
t.rspec_opts = %w[--color]
|
2016-10-13 19:50:03 -07:00
|
|
|
t.pattern = './spec{,/*/**}/*{_spec.rb,_spec_marionette.rb}'
|
2013-02-25 11:13:03 -08:00
|
|
|
end
|
2010-09-17 18:56:32 -05:00
|
|
|
|
2018-03-17 14:55:00 +03:00
|
|
|
%w[chrome ie edge].each do |driver|
|
|
|
|
RSpec::Core::RakeTask.new(:"spec_#{driver}") do |t|
|
|
|
|
t.rspec_opts = %w[--color]
|
|
|
|
t.pattern = "./spec/*{_spec_#{driver}.rb}"
|
|
|
|
end
|
2015-05-21 11:00:36 -07:00
|
|
|
end
|
|
|
|
|
2017-07-26 12:26:45 -07:00
|
|
|
RSpec::Core::RakeTask.new(:spec_rack) do |t|
|
|
|
|
t.rspec_opts = %w[--color]
|
|
|
|
t.pattern = './spec{,/*/**}/*{_spec.rb}'
|
|
|
|
end
|
|
|
|
|
2018-01-09 14:05:50 -08:00
|
|
|
task spec: [:spec_marionette]
|
2017-03-07 13:19:03 -08:00
|
|
|
|
2010-09-17 18:56:32 -05:00
|
|
|
YARD::Rake::YardocTask.new do |t|
|
2012-01-06 19:15:33 +01:00
|
|
|
t.files = ['lib/**/*.rb']
|
2018-01-09 14:05:50 -08:00
|
|
|
t.options = %w[--markup=markdown]
|
2010-09-17 18:56:32 -05:00
|
|
|
end
|
|
|
|
|
2012-01-26 14:58:25 +01:00
|
|
|
Cucumber::Rake::Task.new(:cucumber) do |task|
|
|
|
|
task.cucumber_opts = ['--format=progress', 'features']
|
|
|
|
end
|
|
|
|
|
2017-11-13 13:04:47 -08:00
|
|
|
task :travis do
|
2017-08-02 12:10:56 -07:00
|
|
|
if ENV['CAPYBARA_FF']
|
|
|
|
Rake::Task[:spec_marionette].invoke
|
2018-03-17 14:55:00 +03:00
|
|
|
elsif ENV['CAPYBARA_IE']
|
|
|
|
Rake::Task[:spec_ie].invoke
|
|
|
|
elsif ENV['CAPYBARA_EDGE']
|
|
|
|
Rake::Task[:spec_edge].invoke
|
2015-05-21 11:00:36 -07:00
|
|
|
else
|
2017-08-02 12:10:56 -07:00
|
|
|
Rake::Task[:spec_chrome].invoke
|
2015-05-21 11:00:36 -07:00
|
|
|
end
|
2018-01-08 12:23:54 -08:00
|
|
|
Rake::Task[:cucumber].invoke
|
2015-05-21 11:00:36 -07:00
|
|
|
end
|
2013-02-25 11:13:03 -08:00
|
|
|
|
2016-10-19 10:35:11 -07:00
|
|
|
task :release do
|
2018-01-03 14:31:56 -08:00
|
|
|
version = Capybara::VERSION
|
2016-10-19 10:35:11 -07:00
|
|
|
puts "Releasing #{version}, y/n?"
|
|
|
|
exit(1) unless STDIN.gets.chomp == 'y'
|
|
|
|
sh "git commit -am 'tagged #{version}' && " \
|
|
|
|
"git tag #{version} && " \
|
|
|
|
'gem build capybara.gemspec && ' \
|
|
|
|
"gem push capybara-#{version}.gem && " \
|
|
|
|
'git push && ' \
|
|
|
|
'git push --tags'
|
|
|
|
end
|
|
|
|
|
2018-01-09 14:05:50 -08:00
|
|
|
task default: %i[spec cucumber]
|