From 2b0d668efcb09136f45522177e1d9d2db3fdac9b Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 15 Sep 2006 09:34:14 +0000 Subject: Dont run FCGIDispatcher tests if mocha is not available git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5118 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/test/abstract_unit.rb | 2 -- railties/test/dispatcher_test.rb | 2 +- railties/test/fcgi_dispatcher_test.rb | 9 +++++++++ 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'railties/test') diff --git a/railties/test/abstract_unit.rb b/railties/test/abstract_unit.rb index eac36d41b3..07aeb77fdf 100644 --- a/railties/test/abstract_unit.rb +++ b/railties/test/abstract_unit.rb @@ -5,8 +5,6 @@ $:.unshift File.dirname(__FILE__) + "/../builtin/rails_info" require 'test/unit' require 'rubygems' -require 'mocha' -require 'stubba' # Needed for the class mock delegation #require File.dirname(__FILE__) + "/../../activesupport/lib/active_support/core_ext/class/attribute_accessors" diff --git a/railties/test/dispatcher_test.rb b/railties/test/dispatcher_test.rb index 360a3e8023..31d1634cc0 100644 --- a/railties/test/dispatcher_test.rb +++ b/railties/test/dispatcher_test.rb @@ -138,4 +138,4 @@ class DispatcherTest < Test::Unit::TestCase def assert_subclasses(howmany, klass, message = klass.subclasses.inspect) assert_equal howmany, klass.subclasses.size, message end -end +end \ No newline at end of file diff --git a/railties/test/fcgi_dispatcher_test.rb b/railties/test/fcgi_dispatcher_test.rb index 303a4fcaeb..7e9adbe9d3 100644 --- a/railties/test/fcgi_dispatcher_test.rb +++ b/railties/test/fcgi_dispatcher_test.rb @@ -1,5 +1,10 @@ require File.dirname(__FILE__) + "/abstract_unit" +begin # rescue LoadError + +require 'mocha' +require 'stubba' + $:.unshift File.dirname(__FILE__) + "/mocks" require 'stringio' @@ -283,3 +288,7 @@ class RailsFCGIHandlerPeriodicGCTest < Test::Unit::TestCase assert_nil @handler.when_ready end end + +rescue LoadError + $stderr.puts "Skipping dispatcher tests. `gem install mocha` and try again." +end \ No newline at end of file -- cgit v1.2.3