Rakefile in yard-0.6.3 vs Rakefile in yard-0.6.4
- old
+ new
@@ -17,30 +17,49 @@
task :install => :gem do
sh "#{SUDO} gem install yard-#{YARD::VERSION}.gem --no-rdoc --no-ri"
end
begin
- require 'spec'
- require 'spec/rake/spectask'
+ hide = '_spec\.rb$,spec_helper\.rb$,ruby_lex\.rb$,autoload\.rb$'
+ hide += ',legacy\/.+_handler,html_syntax_highlight_helper18\.rb$' if RUBY19
+ hide += ',ruby_parser\.rb$,ast_node\.rb$,handlers\/ruby\/[^\/]+\.rb$,html_syntax_highlight_helper\.rb$' if RUBY18
+ require 'rspec'
+ require 'rspec/core/rake_task'
+
desc "Run all specs"
- Spec::Rake::SpecTask.new("specs") do |t|
+ RSpec::Core::RakeTask.new("specs") do |t|
$DEBUG = true if ENV['DEBUG']
- t.spec_opts = ["--format", "specdoc", "--colour"]
- t.spec_opts += ["--require", File.join(File.dirname(__FILE__), 'spec', 'spec_helper')]
- t.spec_files = Dir["spec/**/*_spec.rb"].sort
+ t.rspec_opts = ["--colour", "--format", "documentation"]
+ t.rspec_opts += ["--require", File.join(File.dirname(__FILE__), 'spec', 'spec_helper')]
+ t.pattern = "spec/**/*_spec.rb"
if ENV['RCOV']
- hide = '_spec\.rb$,spec_helper\.rb$,ruby_lex\.rb$,autoload\.rb$'
- hide += ',legacy\/.+_handler,html_syntax_highlight_helper18\.rb$' if RUBY19
- hide += ',ruby_parser\.rb$,ast_node\.rb$,handlers\/ruby\/[^\/]+\.rb$,html_syntax_highlight_helper\.rb$' if RUBY18
t.rcov = true
t.rcov_opts = ['-x', hide]
end
end
task :spec => :specs
rescue LoadError
- warn "warn: RSpec tests not available. `gem install rspec` to enable them."
+ begin # Try for rspec 1.x
+ require 'spec'
+ require 'spec/rake/spectask'
+
+ Spec::Rake::SpecTask.new("specs") do |t|
+ $DEBUG = true if ENV['DEBUG']
+ t.spec_opts = ["--format", "specdoc", "--colour"]
+ t.spec_opts += ["--require", File.join(File.dirname(__FILE__), 'spec', 'spec_helper')]
+ t.pattern = "spec/**/*_spec.rb"
+
+ if ENV['RCOV']
+ t.rcov = true
+ t.rcov_opts = ['-x', hide]
+ end
+ end
+ task :spec => :specs
+ rescue LoadError
+ warn "warn: RSpec tests not available. `gem install rspec` to enable them."
+ end
end
YARD::Rake::YardocTask.new do |t|
t.options += ['--title', "YARD #{YARD::VERSION} Documentation"]
end