Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add 'rake suite' task to run specs across all(?) supported ruby versi…

…ons (and modes)
  • Loading branch information...
commit 08977a263c8580a69433fbcf95508d9cf19ee0fa 1 parent 3cc9f1d
@lsegal authored
Showing with 16 additions and 1 deletion.
  1. +16 −1 Rakefile
View
17 Rakefile
@@ -19,6 +19,19 @@ task :install => :gem do
sh "#{SUDO} gem install yard-#{YARD::VERSION}.gem --no-rdoc --no-ri"
end
+desc 'Run spec suite'
+task :suite do
+ ['ruby186', 'ruby18', 'ruby19', 'ruby192', 'jruby'].each do |ruby|
+ 2.times do |legacy|
+ next if legacy == 1 && ruby =~ /^jruby|18/
+ puts "Running specs with #{ruby}#{legacy == 1 ? ' (in legacy mode)' : ''}"
+ cmd = "#{ruby} -S rake specs SUITE=1 #{legacy == 1 ? 'LEGACY=1' : ''}"
+ puts cmd
+ system(cmd)
+ end
+ end
+end
+
begin
hide = '_spec\.rb$,spec_helper\.rb$,ruby_lex\.rb$,autoload\.rb$'
if YARD::Parser::SourceParser.parser_type == :ruby
@@ -33,9 +46,11 @@ begin
desc "Run all specs"
RSpec::Core::RakeTask.new("specs") do |t|
$DEBUG = true if ENV['DEBUG']
- t.rspec_opts = ["--colour", "--format", "documentation"]
+ t.rspec_opts = ENV['SUITE'] ? ['--format', 'progress'] : ["--colour", "--format", "documentation"]
t.rspec_opts += ["--require", File.join(File.dirname(__FILE__), 'spec', 'spec_helper')]
+ t.rspec_opts += ['-I', YARD::ROOT]
t.pattern = "spec/**/*_spec.rb"
+ t.verbose = $DEBUG ? true : false
if ENV['RCOV']
t.rcov = true
Please sign in to comment.
Something went wrong with that request. Please try again.