tasks/spec.rake in ri_cal-0.6.3 vs tasks/spec.rake in ri_cal-0.7.0
- old
+ new
@@ -33,9 +33,34 @@
Spec::Rake::SpecTask.new(:with_tzinfo_gem) do |t|
t.spec_opts = ['--options', "spec/spec.opts"]
t.spec_files = FileList['spec/**/*_spec.rb']
t.ruby_opts << "-r #{File.join(File.dirname(__FILE__), *%w[gem_loader load_tzinfo_gem])}"
end
+ multiruby_path = `which multiruby`.chomp
+ if multiruby_path.length > 0 && Spec::Rake::SpecTask.instance_methods.include?("ruby_cmd")
+ namespace :multi do
+ desc "Run all specs with multiruby and ActiveSupport"
+ Spec::Rake::SpecTask.new(:with_active_support) do |t|
+ t.spec_opts = ['--options', "spec/spec.opts"]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.ruby_cmd = "#{multiruby_path}"
+ t.verbose = true
+ t.ruby_opts << "-r #{File.join(File.dirname(__FILE__), *%w[gem_loader load_active_support])}"
+ end
+
+ desc "Run all specs multiruby and the tzinfo gem"
+ Spec::Rake::SpecTask.new(:with_tzinfo_gem) do |t|
+ t.spec_opts = ['--options', "spec/spec.opts"]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.ruby_cmd = "#{multiruby_path}"
+ t.verbose = true
+ t.ruby_opts << "-r #{File.join(File.dirname(__FILE__), *%w[gem_loader load_tzinfo_gem])}"
+ end
+ end
+
+ desc "run all specs under multiruby with ActiveSupport and also with the tzinfo gem"
+ task :multi => [:"spec:multi:with_active_support", :"spec:multi:with_tzinfo_gem"]
+ end
end
if RUBY_VERSION.match(/^1\.8\./)
desc 'Run all specs with RCov'
Spec::Rake::SpecTask.new(:rcov) do |t|
\ No newline at end of file