Removing bad logger spec. autospec should work now

This commit is contained in:
Bryan Helmkamp 2008-10-25 16:56:06 -04:00
parent 2473cccb92
commit c2203cf6ad
3 changed files with 22 additions and 44 deletions

View File

@ -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
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

View File

@ -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

View File

@ -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