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