diff options
Diffstat (limited to 'activeresource/test/abstract_unit.rb')
-rw-r--r-- | activeresource/test/abstract_unit.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/activeresource/test/abstract_unit.rb b/activeresource/test/abstract_unit.rb index e612412033..0f11ea482a 100644 --- a/activeresource/test/abstract_unit.rb +++ b/activeresource/test/abstract_unit.rb @@ -1,6 +1,11 @@ +require 'rubygems' require 'test/unit' +gem 'mocha', '>= 0.9.5' +require 'mocha' + $:.unshift "#{File.dirname(__FILE__)}/../lib" +$:.unshift "#{File.dirname(__FILE__)}/../../activesupport/lib" require 'active_resource' require 'active_resource/http_mock' @@ -10,17 +15,9 @@ require 'setter_trap' ActiveResource::Base.logger = Logger.new("#{File.dirname(__FILE__)}/debug.log") def uses_gem(gem_name, test_name, version = '> 0') - require 'rubygems' gem gem_name.to_s, version require gem_name.to_s yield rescue LoadError $stderr.puts "Skipping #{test_name} tests. `gem install #{gem_name}` and try again." end - -# Wrap tests that use Mocha and skip if unavailable. -unless defined? uses_mocha - def uses_mocha(test_name, &block) - uses_gem('mocha', test_name, '>= 0.5.5', &block) - end -end |