diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-05-06 00:14:55 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-05-06 00:14:55 -0700 |
commit | 6d4a4fabbbb04c20cee51c4e374045cc75e2ec16 (patch) | |
tree | ea8067c8494363f2bf40a8992ea94600f623f304 /activeresource/test | |
parent | c585e263ab40101eb0fd71a1d24d0d704f4ce026 (diff) | |
download | rails-6d4a4fabbbb04c20cee51c4e374045cc75e2ec16.tar.gz rails-6d4a4fabbbb04c20cee51c4e374045cc75e2ec16.tar.bz2 rails-6d4a4fabbbb04c20cee51c4e374045cc75e2ec16.zip |
Cherry pick Active Support dependencies. Autoload.
Diffstat (limited to 'activeresource/test')
-rw-r--r-- | activeresource/test/abstract_unit.rb | 9 | ||||
-rw-r--r-- | activeresource/test/base_test.rb | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/activeresource/test/abstract_unit.rb b/activeresource/test/abstract_unit.rb index 0f11ea482a..3398f2dac7 100644 --- a/activeresource/test/abstract_unit.rb +++ b/activeresource/test/abstract_unit.rb @@ -5,19 +5,16 @@ 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' $:.unshift "#{File.dirname(__FILE__)}/../test" require 'setter_trap' +require 'logger' ActiveResource::Base.logger = Logger.new("#{File.dirname(__FILE__)}/debug.log") -def uses_gem(gem_name, test_name, version = '> 0') - gem gem_name.to_s, version - require gem_name.to_s - yield +begin + require 'ruby-debug' rescue LoadError - $stderr.puts "Skipping #{test_name} tests. `gem install #{gem_name}` and try again." end diff --git a/activeresource/test/base_test.rb b/activeresource/test/base_test.rb index 6ed6f1a406..a6cef6b2ae 100644 --- a/activeresource/test/base_test.rb +++ b/activeresource/test/base_test.rb @@ -853,7 +853,7 @@ class BaseTest < Test::Unit::TestCase def test_to_xml matz = Person.find(1) xml = matz.encode - assert xml.starts_with?('<?xml version="1.0" encoding="UTF-8"?>') + assert xml.include?('<?xml version="1.0" encoding="UTF-8"?>') assert xml.include?('<name>Matz</name>') assert xml.include?('<id type="integer">1</id>') end |