Rakefile in dbrady-webrat-0.4.4.1 vs Rakefile in dbrady-webrat-0.4.4.2

- old
+ new

@@ -1,9 +1,10 @@ # require 'rubygems' require "rake/gempackagetask" require 'rake/rdoctask' require "rake/clean" +gem "rspec", "1.2.6" require 'spec' require 'spec/rake/spectask' require 'spec/rake/verify_rcov' require File.expand_path('./lib/webrat.rb') @@ -83,14 +84,51 @@ desc "Generate RDoc" task :docs => :clobber_docs do system "hanna --title 'Webrat #{Webrat::VERSION} API Documentation'" end -desc "Run specs using jruby" -task "spec:jruby" do +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" raise "JRuby tests failed" unless result + + Dir.chdir "spec/integration/rails" do + result = system "multiruby -S rake test_unit:rails" + raise "Rails integration tests failed" unless result + + result = system "jruby -S rake test_unit:rails" + raise "Rails integration tests failed" unless result + end + + Dir.chdir "spec/integration/merb" do + result = system "multiruby -S rake spec" + raise "Merb integration tests failed" unless result + + result = system "jruby -S rake spec" + raise "Rails integration tests failed" unless result + end + + Dir.chdir "spec/integration/sinatra" do + result = system "multiruby -S rake test" + raise "Sinatra integration tests failed" unless result + + result = system "jruby -S rake test" + raise "Sinatra integration tests failed" unless result + end + + Dir.chdir "spec/integration/rack" do + result = system "multiruby -S rake test" + raise "Rack integration tests failed" unless result + + result = system "jruby -S rake test" + raise "Rack integration tests failed" unless result + end + + puts + puts "Multiruby OK!" end desc "Run each spec in isolation to test for dependency issues" task :spec_deps do Dir["spec/**/*_spec.rb"].each do |test| @@ -104,11 +142,11 @@ 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"] + task :integration => ["integration:rails", "integration:merb", "integration:sinatra", "integration:rack"] namespace :integration do desc "Run the Rails integration specs" task :rails => ['rails:webrat'] #,'rails:selenium'] currently not running selenium as it doesn't pass. @@ -138,18 +176,24 @@ desc "Run the Sinatra integration specs" task :sinatra do Dir.chdir "spec/integration/sinatra" do result = system "rake test" - raise "Sinatra tntegration tests failed" unless result + raise "Sinatra integration tests failed" unless result end end + + desc "Run the Sinatra integration specs" + task :rack do + Dir.chdir "spec/integration/rack" do + result = system "rake test" + raise "Rack integration tests failed" unless result + end + end end end task :default => :spec - -task :precommit => ["spec", "spec:jruby", "spec:integration"] desc 'Removes trailing whitespace' task :whitespace do sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;} end \ No newline at end of file