<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -172,7 +172,7 @@ module DataMapper
           connection = create_connection
           return yield(connection)
         rescue =&gt; e
-          DataMapper.logger.error(e)
+          DataMapper.logger.error(e.to_s)
           raise e
         ensure
           close_connection(connection) if connection</diff>
      <filename>lib/dm-core/adapters/data_objects_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -48,7 +48,7 @@ module DataMapper
       class Proxy
         include Assertions
 
-        instance_methods.each { |m| undef_method m unless %w[ __id__ __send__ kind_of? respond_to? assert_kind_of should should_not instance_variable_set instance_variable_get ].include?(m.to_s) }
+        instance_methods.each { |m| undef_method m unless %w[ __id__ __send__ object_id kind_of? respond_to? assert_kind_of should should_not instance_variable_set instance_variable_get ].include?(m.to_s) }
 
         def replace(parent)
           @parent = parent</diff>
      <filename>lib/dm-core/associations/many_to_one.rb</filename>
    </modified>
    <modified>
      <diff>@@ -72,7 +72,7 @@ module DataMapper
       class Proxy
         include Assertions
 
-        instance_methods.each { |m| undef_method m unless %w[ __id__ __send__ class kind_of? respond_to? assert_kind_of should should_not instance_variable_set instance_variable_get ].include?(m.to_s) }
+        instance_methods.each { |m| undef_method m unless %w[ __id__ __send__ class object_id kind_of? respond_to? assert_kind_of should should_not instance_variable_set instance_variable_get ].include?(m.to_s) }
 
         # FIXME: remove when RelationshipChain#get_children can return a Collection
         def all(query = {})
@@ -85,14 +85,14 @@ module DataMapper
             query = args.pop
             @relationship.get_children(@parent, query, :first, *args)
           else
-            super
+            children.first(*args)
           end
         end
 
         def &lt;&lt;(resource)
           assert_mutable
           return self if !resource.new_record? &amp;&amp; self.include?(resource)
-          super
+          children &lt;&lt; resource
           relate_resource(resource)
           self
         end
@@ -100,7 +100,7 @@ module DataMapper
         def push(*resources)
           assert_mutable
           resources.reject { |resource| !resource.new_record? &amp;&amp; self.include?(resource) }
-          super
+          children.push(*resources)
           resources.each { |resource| relate_resource(resource) }
           self
         end
@@ -108,7 +108,7 @@ module DataMapper
         def unshift(*resources)
           assert_mutable
           resources.reject { |resource| !resource.new_record? &amp;&amp; self.include?(resource) }
-          super
+          children.unshift(*resources)
           resources.each { |resource| relate_resource(resource) }
           self
         end
@@ -117,42 +117,42 @@ module DataMapper
           assert_mutable
           each { |resource| orphan_resource(resource) }
           other = other.map { |resource| resource.kind_of?(Hash) ? new_child(resource) : resource }
-          super
+          children.replace(other)
           other.each { |resource| relate_resource(resource) }
           self
         end
 
         def pop
           assert_mutable
-          orphan_resource(super)
+          orphan_resource(children.pop)
         end
 
         def shift
           assert_mutable
-          orphan_resource(super)
+          orphan_resource(children.shift)
         end
 
         def delete(resource)
           assert_mutable
-          orphan_resource(super)
+          orphan_resource(children.delete(resource))
         end
 
         def delete_at(index)
           assert_mutable
-          orphan_resource(super)
+          orphan_resource(children.delete_at(index))
         end
 
         def clear
           assert_mutable
           each { |resource| orphan_resource(resource) }
-          super
+          children.clear
           self
         end
 
         def build(attributes = {})
           assert_mutable
           attributes = default_attributes.merge(attributes)
-          resource = children.respond_to?(:build) ? super(attributes) : new_child(attributes)
+          resource = children.respond_to?(:build) ? children.build(attributes) : new_child(attributes)
           resource
         end
 
@@ -160,7 +160,7 @@ module DataMapper
           assert_mutable
           raise UnsavedParentError, 'You cannot intialize until the parent is saved' if @parent.new_record?
           attributes = default_attributes.merge(attributes)
-          resource = children.respond_to?(:new) ? super(attributes) : @relationship.child_model.new(attributes)
+          resource = children.respond_to?(:new) ? children.new(attributes) : @relationship.child_model.new(attributes)
           self &lt;&lt; resource
           resource
         end
@@ -169,7 +169,7 @@ module DataMapper
           assert_mutable
           raise UnsavedParentError, 'You cannot create until the parent is saved' if @parent.new_record?
           attributes = default_attributes.merge(attributes)
-          resource = children.respond_to?(:create) ? super(attributes) : @relationship.child_model.create(attributes)
+          resource = children.respond_to?(:create) ? children.create(attributes) : @relationship.child_model.create(attributes)
           self &lt;&lt; resource
           resource
         end
@@ -177,25 +177,25 @@ module DataMapper
         def update(attributes = {})
           assert_mutable
           raise UnsavedParentError, 'You cannot mass-update until the parent is saved' if @parent.new_record?
-          super
+          children.update(attributes)
         end
 
         def update!(attributes = {})
           assert_mutable
           raise UnsavedParentError, 'You cannot mass-update without validations until the parent is saved' if @parent.new_record?
-          super
+          children.update!(attributes)
         end
 
         def destroy
           assert_mutable
           raise UnsavedParentError, 'You cannot mass-delete until the parent is saved' if @parent.new_record?
-          super
+          children.destroy
         end
 
         def destroy!
           assert_mutable
           raise UnsavedParentError, 'You cannot mass-delete without validations until the parent is saved' if @parent.new_record?
-          super
+          children.destroy!
         end
 
         def reload</diff>
      <filename>lib/dm-core/associations/one_to_many.rb</filename>
    </modified>
    <modified>
      <diff>@@ -60,14 +60,16 @@ module DataMapper
 
       # @api private
       def parent_model
-        Class === @parent_model ? @parent_model : (Class === @child_model ? @child_model.find_const(@parent_model) : Object.find_const(@parent_model))
+        return @parent_model if model_defined?(@parent_model)
+        @parent_model = @child_model.find_const(@parent_model)
       rescue NameError
         raise NameError, &quot;Cannot find the parent_model #{@parent_model} for #{@child_model}&quot;
       end
 
       # @api private
       def child_model
-        Class === @child_model ? @child_model : (Class === @parent_model ? @parent_model.find_const(@child_model) : Object.find_const(@child_model))
+        return @child_model if model_defined?(@child_model)
+        @child_model = @parent_model.find_const(@child_model)
       rescue NameError
         raise NameError, &quot;Cannot find the child_model #{@child_model} for #{@parent_model}&quot;
       end
@@ -130,7 +132,7 @@ module DataMapper
       # @api private
       def get_parent(child, parent = nil)
         child_value = child_key.get(child)
-        return nil unless child_value.nitems == child_value.size
+        return nil if child_value.any? { |v| v.nil? }
 
         with_repository(parent || parent_model) do
           parent_identity_map = (parent || parent_model).repository.identity_map(parent_model.base_model)
@@ -190,6 +192,10 @@ module DataMapper
         assert_kind_of 'child_model',     child_model,     String, Class
         assert_kind_of 'parent_model',    parent_model,    String, Class
 
+        unless model_defined?(child_model) || model_defined?(parent_model)
+          raise 'at least one of child_model and parent_model must be a Model object'
+        end
+
         if child_properties = options[:child_key]
           assert_kind_of 'options[:child_key]', child_properties, Array
         end</diff>
      <filename>lib/dm-core/associations/relationship.rb</filename>
    </modified>
    <modified>
      <diff>@@ -60,7 +60,7 @@ module DataMapper
       # @api private
       def links
         if remote_relationship.kind_of?(RelationshipChain)
-          remote_relationship.instance_eval { links } + [remote_relationship.instance_eval { near_relationship } ]
+          remote_relationship.send(:links) + [ remote_relationship.send(:near_relationship) ]
         else
           [ remote_relationship ]
         end</diff>
      <filename>lib/dm-core/associations/relationship_chain.rb</filename>
    </modified>
    <modified>
      <diff>@@ -491,7 +491,7 @@ module DataMapper
     #
     # @api public
     def respond_to?(method, include_private = false)
-      super || model.public_methods(false).include?(method.to_s) || relationships.has_key?(method)
+      super || model.public_methods(false).map { |m| m.to_s }.include?(method.to_s) || relationships.has_key?(method)
     end
 
     # TODO: add docs
@@ -537,7 +537,7 @@ module DataMapper
 
       unless block_given?
         # It can be helpful (relationship.rb: 112-13, used for SEL) to have a non-lazy Collection.
-        block = lambda {}
+        block = lambda { |c| }
       end
 
       @query          = query
@@ -639,7 +639,7 @@ module DataMapper
     ##
     # @api private
     def method_missing(method, *args, &amp;block)
-      if model.public_methods(false).include?(method.to_s)
+      if model.public_methods(false).map { |m| m.to_s }.include?(method.to_s)
         model.send(:with_scope, query) do
           model.send(method, *args, &amp;block)
         end</diff>
      <filename>lib/dm-core/collection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -443,7 +443,7 @@ module DataMapper
         end
       EOS
 
-      if property.primitive == TrueClass &amp;&amp; !instance_methods.include?(property.name.to_s)
+      if property.primitive == TrueClass &amp;&amp; !instance_methods.map { |m| m.to_s }.include?(property.name.to_s)
         class_eval &lt;&lt;-EOS, __FILE__, __LINE__
           #{property.reader_visibility}
           alias #{property.name} #{property.getter}
@@ -453,7 +453,7 @@ module DataMapper
 
     # defines the setter for the property
     def create_property_setter(property)
-      unless instance_methods.include?(&quot;#{property.name}=&quot;)
+      unless instance_methods.map { |m| m.to_s }.include?(&quot;#{property.name}=&quot;)
         class_eval &lt;&lt;-EOS, __FILE__, __LINE__
           #{property.writer_visibility}
           def #{property.name}=(value)</diff>
      <filename>lib/dm-core/model.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@ if HAS_SQLITE3
       FileUtils.touch(db2)
       DataMapper.setup(:custom_db1, &quot;sqlite3://#{db1}&quot;)
       DataMapper.setup(:custom_db2, &quot;sqlite3://#{db2}&quot;)
-      class CustomParent
+      class ::CustomParent
         include DataMapper::Resource
         def self.default_repository_name
           :custom_db1
@@ -20,7 +20,7 @@ if HAS_SQLITE3
           has n, :custom_childs
         end
       end
-      class CustomChild
+      class ::CustomChild
         include DataMapper::Resource
         def self.default_repository_name
           :custom_db2
@@ -70,7 +70,7 @@ end
 
 if ADAPTER
   repository(ADAPTER) do
-    class Machine
+    class ::Machine
       include DataMapper::Resource
 
       def self.default_repository_name
@@ -84,7 +84,7 @@ if ADAPTER
       has n, :fussy_areas, :class_name =&gt; 'Area', :rating.gte =&gt; 3, :type =&gt; 'particular'
     end
 
-    class Area
+    class ::Area
       include DataMapper::Resource
 
       def self.default_repository_name
@@ -99,7 +99,7 @@ if ADAPTER
       belongs_to :machine
     end
 
-    class Pie
+    class ::Pie
       include DataMapper::Resource
 
       def self.default_repository_name
@@ -112,7 +112,7 @@ if ADAPTER
       belongs_to :sky
     end
 
-    class Sky
+    class ::Sky
       include DataMapper::Resource
 
       def self.default_repository_name
@@ -125,7 +125,7 @@ if ADAPTER
       has 1, :pie
     end
 
-    class Ultrahost
+    class ::Ultrahost
       include DataMapper::Resource
 
       def self.default_repository_name
@@ -138,7 +138,7 @@ if ADAPTER
       has n, :ultraslices, :order =&gt; [:id.desc]
     end
 
-    class Ultraslice
+    class ::Ultraslice
       include DataMapper::Resource
 
       def self.default_repository_name
@@ -151,7 +151,7 @@ if ADAPTER
       belongs_to :ultrahost
     end
 
-    class Node
+    class ::Node
       include DataMapper::Resource
 
       def self.default_repository_name
@@ -165,7 +165,7 @@ if ADAPTER
       belongs_to :parent, :class_name =&gt; 'Node', :child_key =&gt; [ :parent_id ]
     end
 
-    class MadeUpThing
+    class ::MadeUpThing
       include DataMapper::Resource
 
       def self.default_repository_name
@@ -178,7 +178,7 @@ if ADAPTER
       belongs_to :machine
     end
 
-    module Models
+    module ::Models
       class Project
         include DataMapper::Resource
 
@@ -220,7 +220,7 @@ if ADAPTER
       end
     end
 
-    class Galaxy
+    class ::Galaxy
       include DataMapper::Resource
 
       def self.default_repository_name
@@ -231,7 +231,7 @@ if ADAPTER
       property :size, Float,  :key =&gt; true, :precision =&gt; 15, :scale =&gt; 6
     end
 
-    class Star
+    class ::Star
       include DataMapper::Resource
 
       def self.default_repository_name
@@ -303,7 +303,7 @@ if ADAPTER
       end
 
       it 'should create the foreign key property immediately' do
-        class Duck
+        class ::Duck
           include DataMapper::Resource
           property :id, Serial
           belongs_to :sky
@@ -334,7 +334,7 @@ if ADAPTER
 
       it '#belongs_to with namespaced models' do
         repository(ADAPTER) do
-          module FlightlessBirds
+          module ::FlightlessBirds
             class Ostrich
               include DataMapper::Resource
               property :id, Serial
@@ -728,7 +728,7 @@ if ADAPTER
     describe 'through-associations' do
       before :all do
         repository(ADAPTER) do
-          module Sweets
+          module ::Sweets
             class Shop
               include DataMapper::Resource
               def self.default_repository_name
@@ -1219,7 +1219,7 @@ if ADAPTER
     if false # Many to many not yet implemented
     describe &quot;many to many associations&quot; do
       before(:all) do
-        class RightItem
+        class ::RightItem
           include DataMapper::Resource
 
           def self.default_repository_name
@@ -1232,7 +1232,7 @@ if ADAPTER
           has n..n, :left_items
         end
 
-        class LeftItem
+        class ::LeftItem
           include DataMapper::Resource
 
           def self.default_repository_name</diff>
      <filename>spec/integration/association_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ if ADAPTER
   describe 'through-associations' do
     before :all do
       repository(ADAPTER) do
-        class Tag
+        class ::Tag
           include DataMapper::Resource
           def self.default_repository_name
             ADAPTER
@@ -22,7 +22,7 @@ if ADAPTER
           has n, :posts, :through =&gt; :taggings
         end
 
-        class Tagging
+        class ::Tagging
           include DataMapper::Resource
           def self.default_repository_name
             ADAPTER
@@ -35,7 +35,7 @@ if ADAPTER
           belongs_to :tag
         end
 
-        class Post
+        class ::Post
           include DataMapper::Resource
           def self.default_repository_name
             ADAPTER
@@ -61,7 +61,7 @@ if ADAPTER
                  Post.taggings.tag.voided =&gt; true
         end
 
-        class Relationship
+        class ::Relationship
           include DataMapper::Resource
           def self.default_repository_name
             ADAPTER</diff>
      <filename>spec/integration/association_through_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;..&quot;, &quot;spec_hel
 
 describe DataMapper::Associations::ManyToMany::Proxy do
   before :all do
-    class Editor
+    class ::Editor
       include DataMapper::Resource
 
       def self.default_repository_name; ADAPTER end
@@ -15,7 +15,7 @@ describe DataMapper::Associations::ManyToMany::Proxy do
 
     Object.send(:remove_const, :Book) if defined?(Book)
 
-    class Book
+    class ::Book
       include DataMapper::Resource
 
       def self.default_repository_name; ADAPTER end
@@ -190,7 +190,7 @@ describe DataMapper::Associations::ManyToMany::Proxy do
 
   describe &quot;with natural keys&quot; do
     before :all do
-      class Author
+      class ::Author
         include DataMapper::Resource
 
         def self.default_repository_name; ADAPTER end
@@ -200,7 +200,7 @@ describe DataMapper::Associations::ManyToMany::Proxy do
         has n, :books, :through =&gt; Resource
       end
 
-      class Book
+      class ::Book
         has n, :authors, :through =&gt; Resource
       end
     end
@@ -237,7 +237,7 @@ describe DataMapper::Associations::ManyToMany::Proxy do
 
   describe &quot;When join model has non-serial (integer) natural keys.&quot; do
     before :all do
-      class Tag
+      class ::Tag
         include DataMapper::Resource
 
         def self.default_repository_name; ADAPTER end
@@ -249,7 +249,7 @@ describe DataMapper::Associations::ManyToMany::Proxy do
         has n, :books, :through =&gt; :book_taggings
       end
 
-      class BookTagging
+      class ::BookTagging
         include DataMapper::Resource
 
         def self.default_repository_name; ADAPTER end
@@ -261,7 +261,7 @@ describe DataMapper::Associations::ManyToMany::Proxy do
         belongs_to :tag
       end
 
-      class Book
+      class ::Book
         has n, :book_taggings
         has n, :tags, :through =&gt; :book_taggings
       end
@@ -296,7 +296,7 @@ describe DataMapper::Associations::ManyToMany::Proxy do
 
   describe &quot;with renamed associations&quot; do
     before :all do
-      class Singer
+      class ::Singer
         include DataMapper::Resource
 
         def self.default_repository_name; ADAPTER end
@@ -307,7 +307,7 @@ describe DataMapper::Associations::ManyToMany::Proxy do
         has n, :tunes, :through =&gt; Resource, :class_name =&gt; 'Song'
       end
 
-      class Song
+      class ::Song
         include DataMapper::Resource
 
         def self.default_repository_name; ADAPTER end</diff>
      <filename>spec/integration/associations/many_to_many_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -58,7 +58,7 @@ if ADAPTER
           step_child = ManyToOneSpec::StepChild.first(:id =&gt; @step_child.id)
           logger do |log|
             # should retrieve from the IdentityMap
-            child.parent.object_id.should == parent.object_id
+            child.parent.should equal(parent)
 
             # should retrieve from the datasource
             other = step_child.parent</diff>
      <filename>spec/integration/associations/many_to_one_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'spec_hel
 require 'pp'
 describe &quot;OneToMany&quot; do
   before(:all) do
-    class Team
+    class ::Team
       include DataMapper::Resource
 
       def self.default_repository_name; ADAPTER end
@@ -14,10 +14,10 @@ describe &quot;OneToMany&quot; do
       has n, :players
     end
 
-    class BaseballTeam &lt; Team
+    class ::BaseballTeam &lt; Team
     end
 
-    class Player
+    class ::Player
       include DataMapper::Resource
 
       def self.default_repository_name; ADAPTER end</diff>
      <filename>spec/integration/associations/one_to_many_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -561,7 +561,7 @@ if ADAPTER
           end
 
           it &quot;should find a resource in a collection by typecasting the key&quot; do
-            resource = @collection.get(@nancy.key.to_s)
+            resource = @collection.get(*@nancy.key)
             resource.should be_kind_of(DataMapper::Resource)
             resource.id.should == @nancy.id
           end
@@ -569,7 +569,7 @@ if ADAPTER
           it 'should not find a resource not in the collection' do
             @query.update(:offset =&gt; 0, :limit =&gt; 3)
             @david = Zebra.create(:name =&gt; 'David', :age =&gt; 15,  :notes =&gt; 'Albino')
-            @collection.get(@david.key).should be_nil
+            @collection.get(*@david.key).should be_nil
           end
         end
 </diff>
      <filename>spec/integration/collection_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,7 +27,7 @@ describe &quot;DataMapper::DependencyQueue&quot; do
       before :each do
         @q.add('MissingConstant') { |klass| klass.instance_variable_set(&quot;@resolved&quot;, true) } # add before MissingConstant is loaded
 
-        class MissingConstant
+        class ::MissingConstant
         end
       end
 </diff>
      <filename>spec/integration/dependency_queue_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
 
 if ADAPTER
-  module ModelSpec
+  module ::ModelSpec
     class STI
       include DataMapper::Resource
 </diff>
      <filename>spec/integration/model_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ if HAS_MYSQL
     end
 
     before :all do
-      class Sputnik
+      class ::Sputnik
         include DataMapper::Resource
 
         property :id, Serial</diff>
      <filename>spec/integration/mysql_adapter_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ if HAS_POSTGRES
 
     describe &quot;auto migrating&quot; do
       before :all do
-        class Sputnik
+        class ::Sputnik
           include DataMapper::Resource
 
           property :id, Serial
@@ -32,7 +32,7 @@ if HAS_POSTGRES
     describe '#312' do
       it &quot;should behave sanely for time fields&quot; do
 
-        class Thing
+        class ::Thing
           include DataMapper::Resource
           property :id, Integer, :serial =&gt; true
           property :created_at, Time
@@ -57,7 +57,7 @@ if HAS_POSTGRES
 
     describe &quot;querying metadata&quot; do
       before :all do
-        class Sputnik
+        class ::Sputnik
           include DataMapper::Resource
 
           property :id, Serial
@@ -86,7 +86,7 @@ if HAS_POSTGRES
 
     describe &quot;handling transactions&quot; do
       before :all do
-        class Sputnik
+        class ::Sputnik
           include DataMapper::Resource
 
           property :id, Serial
@@ -118,14 +118,14 @@ if HAS_POSTGRES
 
     describe &quot;reading &amp; writing a database&quot; do
       before :all do
-        class User
+        class ::User
           include DataMapper::Resource
 
           property :id, Serial
           property :name, DM::Text
         end
 
-        class Voyager
+        class ::Voyager
           include DataMapper::Resource
           storage_names[:postgres] = 'voyagers'
 
@@ -163,7 +163,7 @@ if HAS_POSTGRES
         result.should be_kind_of(Array)
         row = result.first
         row.should be_kind_of(Struct)
-        row.members.should == %w{id name}
+        row.members.map { |m| m.to_s }.should == %w{id name}
 
         row.id.should == 1
         row.name.should == 'Paul'
@@ -182,7 +182,7 @@ if HAS_POSTGRES
 
     describe &quot;CRUD for serial Key&quot; do
       before :all do
-        class VideoGame
+        class ::VideoGame
           include DataMapper::Resource
 
           property :id, Serial
@@ -282,7 +282,7 @@ if HAS_POSTGRES
 
     describe &quot;CRUD for Composite Key&quot; do
       before :all do
-        class BankCustomer
+        class ::BankCustomer
           include DataMapper::Resource
 
           property :bank, String, :key =&gt; true
@@ -376,7 +376,7 @@ if HAS_POSTGRES
 
     describe &quot;Ordering a Query&quot; do
       before :all do
-        class SailBoat
+        class ::SailBoat
           include DataMapper::Resource
           property :id, Serial
           property :name, String
@@ -423,7 +423,7 @@ if HAS_POSTGRES
 
     describe &quot;Lazy Loaded Properties&quot; do
       before :all do
-        class SailBoat
+        class ::SailBoat
           include DataMapper::Resource
           property :id, Serial
           property :notes, String, :lazy =&gt; [:notes]
@@ -467,7 +467,7 @@ if HAS_POSTGRES
 
     describe &quot;finders&quot; do
       before :all do
-        class SerialFinderSpec
+        class ::SerialFinderSpec
           include DataMapper::Resource
 
           property :id, Serial
@@ -528,7 +528,7 @@ if HAS_POSTGRES
 
     describe &quot;belongs_to associations&quot; do
       before :all do
-        class Engine
+        class ::Engine
           include DataMapper::Resource
           def self.default_repository_name; :postgres end
 
@@ -536,7 +536,7 @@ if HAS_POSTGRES
           property :name, String
         end
 
-        class Yard
+        class ::Yard
           include DataMapper::Resource
           def self.default_repository_name; :postgres end
 
@@ -617,7 +617,7 @@ if HAS_POSTGRES
 
     describe &quot;has n associations&quot; do
       before :all do
-        class Host
+        class ::Host
           include DataMapper::Resource
           def self.default_repository_name; :postgres end
 
@@ -627,7 +627,7 @@ if HAS_POSTGRES
           has n, :slices
         end
 
-        class Slice
+        class ::Slice
           include DataMapper::Resource
           def self.default_repository_name; :postgres end
 </diff>
      <filename>spec/integration/postgres_adapter_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,15 @@
 require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
 
-gem 'fastercsv', '~&gt;1.4.0'
-require 'fastercsv'
+if RUBY_VERSION &gt;= '1.9.0'
+  require 'csv'
+else
+  gem 'fastercsv', '~&gt;1.4.0'
+  require 'fastercsv'
+end
 
 describe DataMapper::Property do
   before do
-    module PropertySpec
+    module ::PropertySpec
       class Resource
         include DataMapper::Resource
       end
@@ -23,7 +27,7 @@ if ADAPTER
   describe DataMapper::Property, &quot;with #{ADAPTER}&quot; do
     describe &quot; tracking strategies&quot; do
       before :all do
-        class Actor
+        class ::Actor
           include DataMapper::Resource
 
           property :id, Serial
@@ -145,7 +149,7 @@ if ADAPTER
 
     describe &quot;lazy loading&quot; do
       before :all do
-        class RowBoat
+        class ::RowBoat
           include DataMapper::Resource
           property :id, Serial
           property :notes, String, :lazy =&gt; [:notes]
@@ -198,7 +202,7 @@ if ADAPTER
 
     describe 'defaults' do
       before :all do
-        class Catamaran
+        class ::Catamaran
           include DataMapper::Resource
           property :id, Serial
           property :name, String</diff>
      <filename>spec/integration/property_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -424,8 +424,8 @@ if ADAPTER
         factory = DataMapper::Associations::Relationship.new(
           :factory,
           ADAPTER,
-          'QuerySpec::Vehicle',
-          'QuerySpec::Factory',
+          QuerySpec::Vehicle,
+          QuerySpec::Factory,
           { :child_key =&gt; [ :factory_id ], :parent_key =&gt; [ :id ] }
         )
         results = repository(ADAPTER) { QuerySpec::Vehicle.all(:links =&gt; [ factory ]) }
@@ -446,8 +446,8 @@ if ADAPTER
         region = DataMapper::Associations::Relationship.new(
           :region,
           ADAPTER,
-          'QuerySpec::Factory',
-          'QuerySpec::Region',
+          QuerySpec::Factory,
+          QuerySpec::Region,
           { :child_key =&gt; [ :region_id ], :parent_key =&gt; [ :id ] }
         )
         results = repository(ADAPTER) { QuerySpec::Vehicle.all(:links =&gt; [ 'factory', region ]) }</diff>
      <filename>spec/integration/query_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
 if ADAPTER
   describe DataMapper::Repository, &quot;with #{ADAPTER}&quot; do
     before :all do
-      class SerialFinderSpec
+      class ::SerialFinderSpec
         include DataMapper::Resource
 
         property :id, Serial</diff>
      <filename>spec/integration/repository_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ if HAS_SQLITE3
 
     describe &quot;auto migrating&quot; do
       before :all do
-        class Sputnik
+        class ::Sputnik
           include DataMapper::Resource
 
           property :id, Serial
@@ -30,7 +30,7 @@ if HAS_SQLITE3
 
     describe &quot;querying metadata&quot; do
       before :all do
-        class Sputnik
+        class ::Sputnik
           include DataMapper::Resource
 
           property :id, Serial
@@ -76,7 +76,7 @@ if HAS_SQLITE3
 
     describe &quot;handling transactions&quot; do
       before :all do
-        class Sputnik
+        class ::Sputnik
           include DataMapper::Resource
 
           property :id, Serial
@@ -108,7 +108,7 @@ if HAS_SQLITE3
 
     describe &quot;reading &amp; writing a database&quot; do
       before :all do
-        class User
+        class ::User
           include DataMapper::Resource
 
           property :id, Serial
@@ -134,7 +134,7 @@ if HAS_SQLITE3
         result.should be_kind_of(Array)
         row = result.first
         row.should be_kind_of(Struct)
-        row.members.should == %w{id name}
+        row.members.map { |m| m.to_s }.should == %w{id name}
 
         row.id.should == 1
         row.name.should == 'Paul'
@@ -153,7 +153,7 @@ if HAS_SQLITE3
 
     describe &quot;CRUD for serial Key&quot; do
       before :all do
-        class VideoGame
+        class ::VideoGame
           include DataMapper::Resource
 
           property :id, Serial
@@ -255,7 +255,7 @@ if HAS_SQLITE3
 
     describe &quot;CRUD for Composite Key&quot; do
       before :all do
-        class BankCustomer
+        class ::BankCustomer
           include DataMapper::Resource
 
           property :bank, String, :key =&gt; true</diff>
      <filename>spec/integration/sqlite3_adapter_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ if HAS_SQLITE3
 
       @property_class = Struct.new(:name, :type, :nullable, :default, :serial)
 
-      class Book
+      class ::Book
         include DataMapper::Resource
 
         property :id,       Serial
@@ -17,23 +17,23 @@ if HAS_SQLITE3
         property :class_type, Discriminator
       end
 
-      class Propaganda &lt; Book
+      class ::Propaganda &lt; Book
         property :marxist,  Boolean,    :nullable =&gt; false, :default =&gt; false
       end
 
-      class Fiction &lt; Book
+      class ::Fiction &lt; Book
         property :series,   String
       end
 
-      class ShortStory &lt; Fiction
+      class ::ShortStory &lt; Fiction
         property :moral,    String
       end
 
-      class ScienceFiction &lt; Fiction
+      class ::ScienceFiction &lt; Fiction
         property :aliens, Boolean
       end
 
-      class SpaceWestern &lt; ScienceFiction
+      class ::SpaceWestern &lt; ScienceFiction
         property :cowboys, Boolean
       end
     end</diff>
      <filename>spec/integration/sti_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ describe &quot;Strategic Eager Loading&quot; do
   include LoggingHelper
 
   before :all do
-    class Zoo
+    class ::Zoo
       include DataMapper::Resource
       def self.default_repository_name; ADAPTER end
 
@@ -14,7 +14,7 @@ describe &quot;Strategic Eager Loading&quot; do
       has n, :exhibits
     end
 
-    class Exhibit
+    class ::Exhibit
       include DataMapper::Resource
       def self.default_repository_name; ADAPTER end
 
@@ -26,7 +26,7 @@ describe &quot;Strategic Eager Loading&quot; do
       has n, :animals
     end
 
-    class Animal
+    class ::Animal
       include DataMapper::Resource
       def self.default_repository_name; ADAPTER end
 
@@ -67,11 +67,12 @@ describe &quot;Strategic Eager Loading&quot; do
       logger do |log|
         dallas.exhibits.entries # load all exhibits for zoos in identity_map
         dallas.exhibits.size.should == 1
+
         log.readlines.size.should == 1
-      end
 
-      repository.identity_map(Zoo).keys.sort.should == zoo_ids
-      repository.identity_map(Exhibit).keys.sort.should == exhibit_ids
+        repository.identity_map(Zoo).keys.sort.should == zoo_ids
+        repository.identity_map(Exhibit).keys.sort.should == exhibit_ids
+      end
 
       logger do |log|
         zoos.each { |zoo| zoo.exhibits.entries } # issues no queries
@@ -97,16 +98,17 @@ describe &quot;Strategic Eager Loading&quot; do
       logger do |log|
         reptiles = dallas.exhibits(:name =&gt; 'Reptiles')
         reptiles.size.should == 1
+
         log.readlines.size.should == 1
       end
 
       logger do |log|
         primates = dallas.exhibits(:name =&gt; 'Primates')
         primates.size.should == 1
+        primates.should_not == reptiles
+
         log.readlines.size.should == 1
       end
-
-      primates.should_not == reptiles
     end
   end
 
@@ -121,11 +123,12 @@ describe &quot;Strategic Eager Loading&quot; do
 
       logger do |log|
         bear.exhibit
+
+        repository.identity_map(Animal).keys.sort.should == animal_ids
+        repository.identity_map(Exhibit).keys.sort.should == exhibit_ids
+
         log.readlines.size.should == 1
       end
-
-      repository.identity_map(Animal).keys.sort.should == animal_ids
-      repository.identity_map(Exhibit).keys.sort.should == exhibit_ids
     end
   end
 </diff>
      <filename>spec/integration/strategic_eager_loading_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,14 @@
 require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
 
-gem 'fastercsv', '~&gt;1.4.0'
-require 'fastercsv'
+if RUBY_VERSION &gt;= '1.9.0'
+  require 'csv'
+else
+  gem 'fastercsv', '~&gt;1.4.0'
+  require 'fastercsv'
+end
 
 if ADAPTER
-  module TypeTests
+  module ::TypeTests
     class Impostor &lt; DataMapper::Type
       primitive String
     end
@@ -25,7 +29,7 @@ if ADAPTER
     end
   end
 
-  class Lemon
+  class ::Lemon
     include DataMapper::Resource
 
     def self.default_repository_name
@@ -37,7 +41,7 @@ if ADAPTER
     property :deleted_at, DataMapper::Types::ParanoidDateTime
   end
 
-  class Lime
+  class ::Lime
     include DataMapper::Resource
 
     def self.default_repository_name
@@ -199,7 +203,7 @@ if ADAPTER
         DataMapper::Repository.adapters[:alternate_paranoid] = repository(ADAPTER).adapter.dup
 
         Object.send(:remove_const, :Orange) if defined?(Orange)
-        class Orange
+        class ::Orange
           include DataMapper::Resource
 
           def self.default_repository_name</diff>
      <filename>spec/integration/type_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,18 +1,18 @@
 module LoggingHelper
-  def logger(adapter = ADAPTER, &amp;block)
-    current_adapter = DataObjects.const_get(repository(adapter).adapter.uri.scheme.capitalize)
-    old_logger = current_adapter.logger
+  def logger
+    class &lt;&lt; DataMapper.logger
+      attr_writer :log
+    end
+
+    old_log = DataMapper.logger.log
 
-    log_path = File.join(SPEC_ROOT, &quot;tmp.log&quot;)
-    handle = File.open(log_path, &quot;a+&quot;)
-    current_adapter.logger = DataObjects::Logger.new(log_path, 0)
     begin
-      yield(handle)
+      StringIO.new('') do |io|
+        DataMapper.logger.log = io
+        yield io
+      end
     ensure
-      handle.truncate(0)
-      handle.close
-      current_adapter.logger = old_logger
-      File.delete(log_path)
+      DataMapper.logger.log = old_log
     end
   end
 end</diff>
      <filename>spec/lib/logging_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ SPEC_ROOT = Pathname(__FILE__).dirname.expand_path
 require SPEC_ROOT.parent + 'lib/dm-core'
 
 # Load the various helpers for the spec suite
-Dir[DataMapper.root / 'spec' / 'lib' / '*.rb'].each do |file|
+Dir[(DataMapper.root / 'spec' / 'lib' / '*.rb').to_s].each do |file|
   require file
 end
 </diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ require DataMapper.root / 'spec' / 'unit' / 'adapters' / 'adapter_shared_spec'
 
 describe DataMapper::Adapters::DataObjectsAdapter do
   before :all do
-    class Cheese
+    class ::Cheese
       include DataMapper::Resource
       property :id, Serial
       property :name, String, :nullable =&gt; false
@@ -26,7 +26,7 @@ describe DataMapper::Adapters::DataObjectsAdapter do
   describe &quot;#find_by_sql&quot; do
 
     before do
-      class Plupp
+      class ::Plupp
         include DataMapper::Resource
         property :id, Integer, :key =&gt; true
         property :name, String
@@ -34,7 +34,7 @@ describe DataMapper::Adapters::DataObjectsAdapter do
     end
 
     it &quot;should be added to DataMapper::Model&quot; do
-      DataMapper::Model.instance_methods.include?(&quot;find_by_sql&quot;).should == true
+      DataMapper::Model.instance_methods.map { |m| m.to_s }.include?(&quot;find_by_sql&quot;).should == true
       Plupp.should respond_to(:find_by_sql)
     end
 
@@ -573,7 +573,7 @@ describe DataMapper::Adapters::DataObjectsAdapter do
 
         result = @adapter.query('SQL STRING')
 
-        result.first.members.should == %w{id user_name age}
+        result.first.members.map { |m| m.to_s }.should == %w[ id user_name age ]
       end
 
       it 'should convert each row into the struct' do</diff>
      <filename>spec/unit/adapters/data_objects_adapter_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ describe DataMapper::Adapters::InMemoryAdapter do
   before do
     DataMapper.setup(:inmem, :adapter =&gt; 'in_memory')
 
-    class Heffalump
+    class ::Heffalump
       include DataMapper::Resource
 
       def self.default_repository_name</diff>
      <filename>spec/unit/adapters/in_memory_adapter_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -25,7 +25,7 @@ if HAS_POSTGRES
         @adapter.stub!(:query).and_return([ 0 ])
 
         @original_method = @adapter.class.superclass.instance_method(:upgrade_model_storage)
-        @adapter.class.superclass.send(:define_method, :upgrade_model_storage) {}
+        @adapter.class.superclass.send(:define_method, :upgrade_model_storage) { |repository, model| }
       end
 
       after do
@@ -49,7 +49,7 @@ if HAS_POSTGRES
 
       it 'should execute the superclass upgrade_model_storage' do
         rv = mock('inside super')
-        @adapter.class.superclass.send(:define_method, :upgrade_model_storage) { rv }
+        @adapter.class.superclass.send(:define_method, :upgrade_model_storage) { |repository, model| rv }
         @adapter.upgrade_model_storage(@repository, @model).should == rv
       end
     end
@@ -91,7 +91,7 @@ if HAS_POSTGRES
 
       it 'should execute the superclass upgrade_model_storage' do
         rv = mock('inside super')
-        @adapter.class.superclass.send(:define_method, :create_table_statement) { rv }
+        @adapter.class.superclass.send(:define_method, :create_table_statement) { |repository, model| rv }
         @adapter.create_table_statement(@repository, @model).should == rv
       end
     end
@@ -117,13 +117,13 @@ if HAS_POSTGRES
 
       it 'should not execute the superclass destroy_model_storage if the storage does not exist' do
         rv = mock('inside super')
-        @adapter.class.superclass.send(:define_method, :destroy_model_storage) { rv }
+        @adapter.class.superclass.send(:define_method, :destroy_model_storage) { |repository, model| rv }
         @adapter.destroy_model_storage(@repository, @model).should_not == rv
       end
 
       it 'should execute the superclass destroy_model_storage if the storage exists' do
         rv = mock('inside super')
-        @adapter.class.superclass.send(:define_method, :destroy_model_storage) { rv }
+        @adapter.class.superclass.send(:define_method, :destroy_model_storage) { |repository, model| rv }
         @adapter.stub!(:storage_exists?).and_return(true)
 
         @adapter.destroy_model_storage(@repository, @model).should == rv</diff>
      <filename>spec/unit/adapters/postgres_adapter_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ describe DataMapper::Associations::ManyToMany do
 
   it 'should allow a declaration' do
     lambda do
-      class Supplier
+      class ::Supplier
         has n, :manufacturers, :through =&gt; Resource
       end
     end.should_not raise_error
@@ -14,7 +14,7 @@ describe DataMapper::Associations::ManyToMany do
 
   it 'should handle models inside modules' do
     lambda do
-      module Content
+      module ::Content
         class Dialect
           has n, :locales, :through =&gt; Resource, :class_name =&gt; &quot;Language::Locale&quot;
         end</diff>
      <filename>spec/unit/associations/many_to_many_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ describe DataMapper::Associations::ManyToOne do
 
   it 'should allow a declaration' do
     lambda do
-      class Vehicle
+      class ::Vehicle
         belongs_to :manufacturer
       end
     end.should_not raise_error
@@ -102,7 +102,7 @@ describe DataMapper::Associations::ManyToOne::Proxy do
       end
 
       it 'should save the parent' do
-        @relationship.should_receive(:with_repository).and_yield(@repository)
+        @relationship.should_receive(:with_repository).and_yield
         @parent.should_receive(:save).with(no_args)
         @association.save
       end
@@ -112,7 +112,7 @@ describe DataMapper::Associations::ManyToOne::Proxy do
         child_key.should_receive(:set).and_return(true)
         parent_key = mock(&quot;parent_key&quot;)
         parent_key.should_receive(:get).and_return(1)
-        @relationship.should_receive(:with_repository).and_yield(@repository)
+        @relationship.should_receive(:with_repository).and_yield
         @relationship.should_receive(:child_key).and_return(child_key)
         @relationship.should_receive(:parent_key).and_return(parent_key)
         save_results = mock('save results')</diff>
      <filename>spec/unit/associations/many_to_one_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -85,11 +85,11 @@ describe DataMapper::Associations::OneToMany do
 
     describe 'proxy accessor' do
       before :all do
-        class User
+        class ::User
           include DataMapper::Resource
         end
 
-        class Order
+        class ::Order
           include DataMapper::Resource
         end
       end</diff>
      <filename>spec/unit/associations/one_to_many_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,8 +8,8 @@ describe DataMapper::Associations::Relationship do
     belongs_to = DataMapper::Associations::Relationship.new(
       :manufacturer,
       :mock,
-      'Vehicle',
-      'Manufacturer',
+      Vehicle,
+      Manufacturer,
       { :child_key =&gt; [ :manufacturer_id ] }
     )
 
@@ -23,8 +23,8 @@ describe DataMapper::Associations::Relationship do
     belongs_to = DataMapper::Associations::Relationship.new(
       :manufacturer,
       :mock,
-      'Vehicle',
-      'Manufacturer',
+      Vehicle,
+      Manufacturer,
       { :child_key =&gt; [ :manufacturer_id ], :parent_key =&gt; [ :id ] }
     )
 
@@ -44,8 +44,8 @@ describe DataMapper::Associations::Relationship do
     has_many = DataMapper::Associations::Relationship.new(
       :models,
       :mock,
-      'Vehicle',
-      'Manufacturer',
+      Vehicle,
+      Manufacturer,
       { :child_key =&gt; [:model_id] }
     )
 </diff>
      <filename>spec/unit/associations/relationship_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,7 @@ describe &quot;DataMapper::Associations&quot; do
 
   describe &quot;#many_to_one_relationships&quot; do
     before :all do
-      module MTORelationships
+      module ::MTORelationships
         class A
           include DataMapper::Resource
           def self.default_repository_name
@@ -46,11 +46,11 @@ describe &quot;DataMapper::Associations&quot; do
   end
 
   describe &quot;.relationships&quot; do
-    class B
+    class ::B
       include DataMapper::Resource
     end
 
-    class C
+    class ::C
       include DataMapper::Resource
 
       repository(:mock) do
@@ -58,15 +58,15 @@ describe &quot;DataMapper::Associations&quot; do
       end
     end
 
-    class D
+    class ::D
       include DataMapper::Resource
       has 1, :b
     end
 
-    class E &lt; D
+    class ::E &lt; D
     end
 
-    class F &lt; D
+    class ::F &lt; D
       has 1, :a
     end
 
@@ -92,7 +92,7 @@ describe &quot;DataMapper::Associations&quot; do
 
     it &quot;should allow a declaration&quot; do
       lambda do
-        class Manufacturer
+        class ::Manufacturer
           has 1, :halo_car
         end
       end.should_not raise_error
@@ -100,7 +100,7 @@ describe &quot;DataMapper::Associations&quot; do
 
     it &quot;should not allow a constraint that is not an Integer, Range or Infinity&quot; do
       lambda do
-        class Manufacturer
+        class ::Manufacturer
           has '1', :halo_car
         end
       end.should raise_error(ArgumentError)
@@ -108,7 +108,7 @@ describe &quot;DataMapper::Associations&quot; do
 
     it &quot;should not allow a constraint where the min is larger than the max&quot; do
       lambda do
-        class Manufacturer
+        class ::Manufacturer
           has 1..0, :halo_car
         end
       end.should raise_error(ArgumentError)
@@ -119,7 +119,7 @@ describe &quot;DataMapper::Associations&quot; do
         with(:vehicles, Manufacturer, { :min =&gt; 1, :max =&gt; 2 }).
         and_return(@relationship)
 
-      class Manufacturer
+      class ::Manufacturer
         has(1..2, :vehicles, :min =&gt; 5, :max =&gt; 10).should == mock_relationship
       end
     end
@@ -130,7 +130,7 @@ describe &quot;DataMapper::Associations&quot; do
           with(:halo_car, Manufacturer, { :min =&gt; 1, :max =&gt; 1 }).
           and_return(@relationship)
 
-        class Manufacturer
+        class ::Manufacturer
           has(1, :halo_car).should == mock_relationship
         end
       end
@@ -140,7 +140,7 @@ describe &quot;DataMapper::Associations&quot; do
           with(:halo_car, Manufacturer, { :min =&gt; 0, :max =&gt; 1 }).
           and_return(@relationship)
 
-        class Manufacturer
+        class ::Manufacturer
           has(0..1, :halo_car).should == mock_relationship
         end
       end
@@ -150,7 +150,7 @@ describe &quot;DataMapper::Associations&quot; do
           with(:halo_car, Manufacturer, { :min =&gt; 1, :max =&gt; 1, :class_name =&gt; 'Car' }).
           and_return(@relationship)
 
-        class Manufacturer
+        class ::Manufacturer
           has(1, :halo_car, :class_name =&gt; 'Car').should == mock_relationship
         end
       end
@@ -162,7 +162,7 @@ describe &quot;DataMapper::Associations&quot; do
           with(:vehicles, Manufacturer, { :min =&gt; 0, :max =&gt; @n }).
           and_return(@relationship)
 
-        class Manufacturer
+        class ::Manufacturer
           has(n, :vehicles).should == mock_relationship
         end
       end
@@ -172,7 +172,7 @@ describe &quot;DataMapper::Associations&quot; do
           with(:vehicles, Manufacturer, { :min =&gt; 4, :max =&gt; 4 }).
           and_return(@relationship)
 
-        class Manufacturer
+        class ::Manufacturer
           has(4, :vehicles).should == mock_relationship
         end
       end
@@ -182,7 +182,7 @@ describe &quot;DataMapper::Associations&quot; do
           with(:vehicles, Manufacturer, { :min =&gt; 2, :max =&gt; 4 }).
           and_return(@relationship)
 
-        class Manufacturer
+        class ::Manufacturer
           has(2..4, :vehicles).should == mock_relationship
         end
       end
@@ -192,7 +192,7 @@ describe &quot;DataMapper::Associations&quot; do
           with(:vehicles, Manufacturer, { :min =&gt; 1, :max =&gt; @n, :class_name =&gt; 'Car' }).
           and_return(@relationship)
 
-        class Manufacturer
+        class ::Manufacturer
           has(1..n, :vehicles, :class_name =&gt; 'Car').should == mock_relationship
         end
       end
@@ -200,7 +200,7 @@ describe &quot;DataMapper::Associations&quot; do
       # do not remove or change this spec.
       it &quot;should raise an exception when n..n is used for the cardinality&quot; do
         lambda do
-          class Manufacturer
+          class ::Manufacturer
             has n..n, :subsidiaries, :class_name =&gt; 'Manufacturer'
           end
         end.should raise_error(ArgumentError)
@@ -211,7 +211,7 @@ describe &quot;DataMapper::Associations&quot; do
           with(:suppliers, Vehicle, { :min =&gt; 0, :max =&gt; @n, :through =&gt; :manufacturers }).
           and_return(@relationship)
 
-        class Vehicle
+        class ::Vehicle
           has(n, :suppliers, :through =&gt; :manufacturers).should == mock_relationship
         end
       end
@@ -224,7 +224,7 @@ describe &quot;DataMapper::Associations&quot; do
         with(:vehicle, Manufacturer, {}).
         and_return(@relationship)
 
-      class Manufacturer
+      class ::Manufacturer
         belongs_to(:vehicle).should == mock_relationship
       end
     end
@@ -234,7 +234,7 @@ describe &quot;DataMapper::Associations&quot; do
         with(:vehicle, Manufacturer, { :class_name =&gt; 'Car' }).
         and_return(@relationship)
 
-      class Manufacturer
+      class ::Manufacturer
         belongs_to(:vehicle, :class_name =&gt; 'Car').should == mock_relationship
       end
     end</diff>
      <filename>spec/unit/associations_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,18 +2,18 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
 
 describe &quot;DataMapper::IdentityMap&quot; do
   before(:all) do
-    class Cow
+    class ::Cow
       include DataMapper::Resource
       property :id, Integer, :key =&gt; true
       property :name, String
     end
 
-    class Chicken
+    class ::Chicken
       include DataMapper::Resource
       property :name, String
     end
 
-    class Pig
+    class ::Pig
       include DataMapper::Resource
       property :id, Integer, :key =&gt; true
       property :composite, Integer, :key =&gt; true</diff>
      <filename>spec/unit/identity_map_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
 describe &quot;DataMapper::Is&quot; do
   describe &quot;.is&quot; do
 
-    module DataMapper
+    module ::DataMapper
 
       module Is
         module Example
@@ -32,17 +32,17 @@ describe &quot;DataMapper::Is&quot; do
       end # module Model
     end # module DataMapper
 
-    class House
+    class ::House
       include DataMapper::Resource
     end
 
-    class Cabin
+    class ::Cabin
       include DataMapper::Resource
     end
 
     it &quot;should raise error unless it finds the plugin&quot; do
       lambda do
-        class House
+        class ::House
           is :no_plugin_by_this_name
         end
       end.should raise_error(DataMapper::PluginNotFoundError)
@@ -50,14 +50,14 @@ describe &quot;DataMapper::Is&quot; do
 
     it &quot;should call plugin is_* method&quot; do
       lambda do
-        class House
+        class ::House
           is :example
         end
       end.should_not raise_error
     end
 
     it &quot;should pass through arguments to plugin is_* method&quot; do
-      class House
+      class ::House
         is :example ,:option1 =&gt; :ping, :option2 =&gt; :pong
       end
 
@@ -68,7 +68,7 @@ describe &quot;DataMapper::Is&quot; do
     it &quot;should not add class_methods before the plugin is activated&quot; do
       Cabin.respond_to?(:example_class_method).should be_false
 
-      class Cabin
+      class ::Cabin
         is :example
       end
 </diff>
      <filename>spec/unit/is_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,14 +3,14 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
 describe DataMapper::Property do
   before :each do
     Object.send(:remove_const, :Zoo) if defined?(Zoo)
-    class Zoo
+    class ::Zoo
       include DataMapper::Resource
 
       property :id, DataMapper::Types::Serial
     end
 
     Object.send(:remove_const, :Name) if defined?(Name)
-    class Name &lt; DataMapper::Type
+    class ::Name &lt; DataMapper::Type
       primitive String
       track :hash
 
@@ -28,7 +28,7 @@ describe DataMapper::Property do
     end
 
     Object.send(:remove_const, :Tomato) if defined?(Tomato)
-    class Tomato
+    class ::Tomato
       include DataMapper::Resource
     end
   end
@@ -429,8 +429,8 @@ describe DataMapper::Property do
         Tomato.class_eval &lt;&lt;-RUBY
           property :botanical_name, String, #{input.inspect}
         RUBY
-        Tomato.send(&quot;#{output[0]}_instance_methods&quot;).should include(&quot;botanical_name&quot;)
-        Tomato.send(&quot;#{output[1]}_instance_methods&quot;).should include(&quot;botanical_name=&quot;)
+        Tomato.send(&quot;#{output[0]}_instance_methods&quot;).map { |m| m.to_s }.should include(&quot;botanical_name&quot;)
+        Tomato.send(&quot;#{output[1]}_instance_methods&quot;).map { |m| m.to_s }.should include(&quot;botanical_name=&quot;)
       end
     end
 
@@ -466,7 +466,7 @@ describe DataMapper::Property do
   # end
 
   it &quot;should append ? to TrueClass property reader methods&quot; do
-    class Potato
+    class ::Potato
       include DataMapper::Resource
       property :id, Integer, :key =&gt; true
       property :fresh, TrueClass</diff>
      <filename>spec/unit/property_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -60,7 +60,7 @@ end
 describe DataMapper::Resource do
   before(:each) do
     Object.send(:remove_const, :Planet) if defined?(Planet)
-    class Planet
+    class ::Planet
       include DataMapper::Resource
 
       storage_names[:legacy] = &quot;dying_planets&quot;
@@ -86,7 +86,7 @@ describe DataMapper::Resource do
     end
 
     Object.send(:remove_const, :Phone) if defined?(Phone)
-    class Phone
+    class ::Phone
       include DataMapper::Resource
 
       property :name, String, :key =&gt; true
@@ -94,7 +94,7 @@ describe DataMapper::Resource do
     end
 
     Object.send(:remove_const, :Fruit) if defined?(Fruit)
-    class Fruit
+    class ::Fruit
       include DataMapper::Resource
 
       property :id, Integer, :key =&gt; true
@@ -102,7 +102,7 @@ describe DataMapper::Resource do
     end
 
     Object.send(:remove_const, :Grain) if defined?(Grain)
-    class Grain
+    class ::Grain
       include DataMapper::Resource
 
       property :id, Serial
@@ -110,7 +110,7 @@ describe DataMapper::Resource do
     end
 
     Object.send(:remove_const, :Vegetable) if defined?(Vegetable)
-    class Vegetable
+    class ::Vegetable
       include DataMapper::Resource
 
       property :id, Serial
@@ -118,12 +118,12 @@ describe DataMapper::Resource do
     end
 
     Object.send(:remove_const, :Banana) if defined?(Banana)
-    class Banana &lt; Fruit
+    class ::Banana &lt; Fruit
       property :type, Discriminator
     end
 
     Object.send(:remove_const, :Cyclist) if defined?(Cyclist)
-    class Cyclist
+    class ::Cyclist
       include DataMapper::Resource
       property :id,         Serial
       property :victories,  Integer
@@ -568,7 +568,7 @@ describe DataMapper::Resource do
 
   describe &quot;inheritance&quot; do
     before(:all) do
-      class Media
+      class ::Media
         include DataMapper::Resource
 
         storage_names[:default] = 'media'
@@ -577,7 +577,7 @@ describe DataMapper::Resource do
         property :name, String, :key =&gt; true
       end
 
-      class NewsPaper &lt; Media
+      class ::NewsPaper &lt; Media
 
         storage_names[:east_coast] = 'mother'
 
@@ -600,7 +600,7 @@ describe DataMapper::Resource do
 
   describe &quot;Single-table Inheritance&quot; do
     before(:all) do
-      class Plant
+      class ::Plant
         include DataMapper::Resource
 
         property :id, Integer, :key =&gt; true
@@ -615,13 +615,13 @@ describe DataMapper::Resource do
         end
       end
 
-      class HousePlant &lt; Plant
+      class ::HousePlant &lt; Plant
         def calculate(int)
           int ** 3
         end
       end
 
-      class PoisonIvy &lt; Plant
+      class ::PoisonIvy &lt; Plant
         def length=(len)
           attribute_set(:length, len - 1)
         end</diff>
      <filename>spec/unit/resource_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
 describe DataMapper::Transaction do
 
   before :all do
-    class Smurf
+    class ::Smurf
       include DataMapper::Resource
       property :id, Integer, :key =&gt; true
     end</diff>
      <filename>spec/unit/transaction_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,7 +16,7 @@ namespace :dm do
   def run_spec(name, files, rcov)
     Spec::Rake::SpecTask.new(name) do |t|
       t.spec_opts &lt;&lt; '--colour' &lt;&lt; '--loadby' &lt;&lt; 'random'
-      t.spec_files = Pathname.glob(ENV['FILES'] || files.to_s)
+      t.spec_files = Pathname.glob(ENV['FILES'] || files.to_s).map { |f| f.to_s }
       t.rcov = rcov
       t.rcov_opts &lt;&lt; '--exclude' &lt;&lt; 'spec,environment.rb'
       t.rcov_opts &lt;&lt; '--text-summary'</diff>
      <filename>tasks/dm.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e36f6618ec885462e246856ed7efb3e0ec1bce2f</id>
    </parent>
  </parents>
  <author>
    <name>Dan Kubb</name>
    <email>dan.kubb@autopilotmarketing.com</email>
  </author>
  <url>http://github.com/dkubb/dm-core/commit/fbd5392e4998a0ae177c3c26c465744488d48b67</url>
  <id>fbd5392e4998a0ae177c3c26c465744488d48b67</id>
  <committed-date>2009-01-19T16:10:29-08:00</committed-date>
  <authored-date>2009-01-19T03:17:17-08:00</authored-date>
  <message>Updated to pass specs when using Ruby 1.9.1</message>
  <tree>6fb0aed97022f1ddba118bb9b846d70bc971bf77</tree>
  <committer>
    <name>Dan Kubb</name>
    <email>dan.kubb@autopilotmarketing.com</email>
  </committer>
</commit>
