Rakefile in kbaum-webrat-0.5.1 vs Rakefile in kbaum-webrat-0.6.1.pre

- old
+ new

@@ -1,66 +1,30 @@ require "rubygems" begin - require 'jeweler' - - Jeweler::Tasks.new do |s| - s.name = "kbaum-webrat" - s.author = "Bryan Helmkamp" - s.email = "bryan" + "@" + "brynary.com" - s.homepage = "http://github.com/brynary/webrat" - s.summary = "Ruby Acceptance Testing for Web applications" - s.description = <<-EOS.strip -Webrat lets you quickly write expressive and robust acceptance tests -for a Ruby web application. It supports simulating a browser inside -a Ruby process to avoid the performance hit and browser dependency of -Selenium or Watir, but the same API can also be used to drive real -Selenium tests when necessary (eg. for testing AJAX interactions). -Most Ruby web frameworks and testing frameworks are supported. - EOS - - s.rubyforge_project = "webrat" - s.extra_rdoc_files = %w[README.rdoc MIT-LICENSE.txt History.txt] - - # Dependencies - s.add_dependency "nokogiri", ">= 1.2.0" - s.add_dependency "rack", ">= 1.0" - - s.add_development_dependency "rails", ">= 2.3" - s.add_development_dependency "merb-core", ">= 1.0" - s.add_development_dependency "launchy" + require 'spec/rake/spectask' +rescue LoadError + desc "Run specs" + task(:spec) { $stderr.puts '`gem install rspec` to run specs' } +else + desc "Run API and Core specs" + Spec::Rake::SpecTask.new do |t| + t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""] + t.spec_files = FileList['spec/public/**/*_spec.rb'] + FileList['spec/private/**/*_spec.rb'] end - Jeweler::RubyforgeTasks.new -rescue LoadError - puts "Jeweler not available. Install it with: gem install jeweler" -end - -# require 'spec' -require 'spec/rake/spectask' -require 'spec/rake/verify_rcov' - -desc "Run API and Core specs" -Spec::Rake::SpecTask.new do |t| - t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""] - t.spec_files = FileList['spec/public/**/*_spec.rb'] + FileList['spec/private/**/*_spec.rb'] -end - -desc "Run all specs in spec directory with RCov" -Spec::Rake::SpecTask.new(:rcov) do |t| - t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""] - t.spec_files = FileList['spec/public/**/*_spec.rb'] + FileList['spec/private/**/*_spec.rb'] - t.rcov = true - t.rcov_opts = lambda do - IO.readlines(File.dirname(__FILE__) + "/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten + desc "Run all specs in spec directory with RCov" + Spec::Rake::SpecTask.new(:rcov) do |t| + t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""] + t.spec_files = FileList['spec/public/**/*_spec.rb'] + FileList['spec/private/**/*_spec.rb'] + t.rcov = true + t.rcov_opts = lambda do + IO.readlines(File.dirname(__FILE__) + "/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten + end end end -RCov::VerifyTask.new(:verify_rcov => :rcov) do |t| - t.threshold = 96.2 # Make sure you have rcov 0.7 or higher! -end - desc "Run everything against multiruby" task :multiruby do result = system "multiruby -S rake spec" raise "Multiruby tests failed" unless result result = system "jruby -S rake spec" @@ -109,22 +73,22 @@ puts "Dependency Issues: #{test}" end end end -task :prepare do - system "ln -s ../../../../.. ./spec/integration/rails/vendor/plugins/webrat" -end - namespace :spec do desc "Run the integration specs" - task :integration => ["integration:rails", "integration:merb", "integration:sinatra", "integration:rack", "integration:mechanize"] + task :integration => [ + "integration:rack", + "integration:sinatra", + "integration:merb", + "integration:mechanize", + "integration:rails:webrat", + "integration:rails:selenium", + ] namespace :integration do - desc "Run the Rails integration specs" - task :rails => ['rails:webrat'] #,'rails:selenium'] currently not running selenium as it doesn't pass. - namespace :rails do task :selenium do Dir.chdir "spec/integration/rails" do result = system "rake test_unit:selenium" raise "Rails integration tests failed" unless result @@ -174,13 +138,8 @@ end desc 'Removes trailing whitespace' task :whitespace do sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;} -end - -if defined?(Jeweler) - task :spec => :check_dependencies - task :build => :gemspec end task :default => :spec