From c2203cf6adc386e7caca1df822368893935ca464 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sat, 25 Oct 2008 16:56:06 -0400 Subject: [PATCH] Removing bad logger spec. autospec should work now --- Rakefile | 55 ++++++++++---------------------- spec/spec_helper.rb | 1 + spec/webrat/core/logging_spec.rb | 10 +++--- 3 files changed, 22 insertions(+), 44 deletions(-) diff --git a/Rakefile b/Rakefile index ce1c1b6..c987574 100644 --- a/Rakefile +++ b/Rakefile @@ -41,46 +41,25 @@ remove_task "test_deps" 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/api/*_spec.rb'] + FileList['spec/webrat/core/*_spec.rb'] + t.spec_files = FileList['spec/**/*_spec.rb'] end -namespace :spec do - desc "Run Rails specs" - Spec::Rake::SpecTask.new(:rails) do |t| - t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""] - t.spec_files = FileList['spec/webrat/rails/*_spec.rb'] - end - - desc "Run Merb specs" - Spec::Rake::SpecTask.new(:merb) do |t| - t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""] - t.spec_files = FileList['spec/webrat/merb/*_spec.rb'] - end - - desc "Run Mechanize specs" - Spec::Rake::SpecTask.new(:mechanize) do |t| - t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""] - t.spec_files = FileList['spec/webrat/mechanize/*_spec.rb'] +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/**/*_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 -# 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 = set_file_list -# t.rcov = true -# t.rcov_opts = lambda do -# IO.readlines(File.dirname(__FILE__) + "/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten -# end -# end -# -# require 'spec/rake/verify_rcov' -# RCov::VerifyTask.new(:verify_rcov => :rcov) do |t| -# t.threshold = 96.2 # Make sure you have rcov 0.7 or higher! -# end -# -# remove_task "default" -# task :default do -# Rake::Task["verify_rcov"].invoke -# end \ No newline at end of file +require 'spec/rake/verify_rcov' +RCov::VerifyTask.new(:verify_rcov => :rcov) do |t| + t.threshold = 96.2 # Make sure you have rcov 0.7 or higher! +end + +remove_task "default" +task :default do + Rake::Task["verify_rcov"].invoke +end \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 53e5896..29f29f7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,6 @@ require "rubygems" require "spec" +require "spec/interop/test" # gem install redgreen for colored test output begin require "redgreen" unless ENV['TM_CURRENT_LINE']; rescue LoadError; end diff --git a/spec/webrat/core/logging_spec.rb b/spec/webrat/core/logging_spec.rb index 73f5bbc..3666057 100644 --- a/spec/webrat/core/logging_spec.rb +++ b/spec/webrat/core/logging_spec.rb @@ -1,12 +1,10 @@ require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper") describe Webrat::Logging do - include Webrat::Logging - it "should log to RAILS_DEFAULT_LOGGER" do - logger = mock("logger") - RAILS_DEFAULT_LOGGER = logger - logger.should_receive(:debug).with("Testing") - debug_log "Testing" + it "should not log if there is no logger" do + klass = Class.new + klass.send(:include, Webrat::Logging) + klass.new.debug_log "Testing" end end \ No newline at end of file