teamcapybara--capybara/Rakefile

65 lines
1.7 KiB
Ruby
Raw Normal View History

require 'rubygems'
require 'rspec/core/rake_task'
require 'cucumber/rake/task'
require 'yard'
desc "Run all examples with Firefox non-marionette"
2017-03-07 16:19:03 -05:00
RSpec::Core::RakeTask.new(:spec_firefox) do |t|
t.rspec_opts = %w[--color]
# 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}'
t.pattern = './spec{,/*/**}/*{_spec.rb,_spec_firefox.rb}'
end
2014-03-31 18:10:27 -04:00
RSpec::Core::RakeTask.new(:spec_marionette) do |t|
t.rspec_opts = %w[--color]
t.pattern = './spec{,/*/**}/*{_spec.rb,_spec_marionette.rb}'
end
2015-05-21 14:00:36 -04:00
RSpec::Core::RakeTask.new(:spec_chrome) do |t|
t.rspec_opts = %w[--color]
t.pattern = './spec/*{_spec_chrome.rb}'
end
RSpec::Core::RakeTask.new(:spec_rack) do |t|
t.rspec_opts = %w[--color]
t.pattern = './spec{,/*/**}/*{_spec.rb}'
end
2017-03-07 16:19:03 -05:00
task :spec => [:spec_marionette]
YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb']
t.options = %w(--markup=markdown)
end
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|
if ENV['CAPYBARA_FF']
Rake::Task[:spec_marionette].invoke
elsif ENV['CAPYBARA_LEGACY_FF']
Rake::Task[:spec_firefox].invoke
Rake::Task[:cucumber].invoke
2015-05-21 14:00:36 -04:00
else
Rake::Task[:spec_chrome].invoke
2015-05-21 14:00:36 -04:00
Rake::Task[:cucumber].invoke
end
end
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
task :default => [:spec, :cucumber]