Removing bad logger spec. autospec should work now
This commit is contained in:
parent
2473cccb92
commit
c2203cf6ad
55
Rakefile
55
Rakefile
|
@ -41,46 +41,25 @@ remove_task "test_deps"
|
||||||
desc "Run API and Core specs"
|
desc "Run API and Core specs"
|
||||||
Spec::Rake::SpecTask.new do |t|
|
Spec::Rake::SpecTask.new do |t|
|
||||||
t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
|
t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
|
||||||
|
t.spec_files = FileList['spec/**/*_spec.rb']
|
||||||
t.spec_files = FileList['spec/api/*_spec.rb'] + FileList['spec/webrat/core/*_spec.rb']
|
|
||||||
end
|
end
|
||||||
|
|
||||||
namespace :spec do
|
desc "Run all specs in spec directory with RCov"
|
||||||
desc "Run Rails specs"
|
Spec::Rake::SpecTask.new(:rcov) do |t|
|
||||||
Spec::Rake::SpecTask.new(:rails) do |t|
|
t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
|
||||||
t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
|
t.spec_files = FileList['spec/**/*_spec.rb']
|
||||||
t.spec_files = FileList['spec/webrat/rails/*_spec.rb']
|
t.rcov = true
|
||||||
end
|
t.rcov_opts = lambda do
|
||||||
|
IO.readlines(File.dirname(__FILE__) + "/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
|
||||||
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']
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# desc "Run all specs in spec directory with RCov"
|
require 'spec/rake/verify_rcov'
|
||||||
# Spec::Rake::SpecTask.new(:rcov) do |t|
|
RCov::VerifyTask.new(:verify_rcov => :rcov) do |t|
|
||||||
# t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
|
t.threshold = 96.2 # Make sure you have rcov 0.7 or higher!
|
||||||
# t.spec_files = set_file_list
|
end
|
||||||
# t.rcov = true
|
|
||||||
# t.rcov_opts = lambda do
|
remove_task "default"
|
||||||
# IO.readlines(File.dirname(__FILE__) + "/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
|
task :default do
|
||||||
# end
|
Rake::Task["verify_rcov"].invoke
|
||||||
# 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
|
|
|
@ -1,5 +1,6 @@
|
||||||
require "rubygems"
|
require "rubygems"
|
||||||
require "spec"
|
require "spec"
|
||||||
|
require "spec/interop/test"
|
||||||
|
|
||||||
# gem install redgreen for colored test output
|
# gem install redgreen for colored test output
|
||||||
begin require "redgreen" unless ENV['TM_CURRENT_LINE']; rescue LoadError; end
|
begin require "redgreen" unless ENV['TM_CURRENT_LINE']; rescue LoadError; end
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
||||||
|
|
||||||
describe Webrat::Logging do
|
describe Webrat::Logging do
|
||||||
include Webrat::Logging
|
|
||||||
|
|
||||||
it "should log to RAILS_DEFAULT_LOGGER" do
|
it "should not log if there is no logger" do
|
||||||
logger = mock("logger")
|
klass = Class.new
|
||||||
RAILS_DEFAULT_LOGGER = logger
|
klass.send(:include, Webrat::Logging)
|
||||||
logger.should_receive(:debug).with("Testing")
|
klass.new.debug_log "Testing"
|
||||||
debug_log "Testing"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue