<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -45,9 +45,12 @@ module Machinery
         self.instance_variables.each do |ivar|
           obj = self.instance_variable_get(ivar)
           next unless obj.is_a?(::ActiveRecord::Base)
-          clone = obj.clone
-          clone.id = obj.id
-          clone.instance_variable_set('@new_record', obj.new_record?)
+
+          clone = obj.class.new
+          clone.instance_variable_set(&quot;@attributes&quot;, obj.instance_variable_get(:@attributes).dup)
+          clone.instance_variable_set(&quot;@new_record&quot;, obj.new_record?)
+          clone.instance_variable_set(&quot;@changed_attributes&quot;, nil)
+
           self.instance_variable_set(ivar, clone)
         end
       end</diff>
      <filename>lib/machinery.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,10 @@
 Gem::Specification.new do |s|
   s.name         = &quot;machinery&quot;
-  s.version      = &quot;0.9.1&quot;
+  s.version      = &quot;0.9.3&quot;
   s.author       = &quot;Lawrence Pit&quot;
   s.email        = &quot;lawrence.pit@gmail.com&quot;
   s.homepage     = &quot;http://github.com/lawrencepit/machinery&quot;
-  s.summary      = &quot;Machinery to create object graphs and speed up tests.&quot;
+  s.summary      = &quot;Machinery to create object graphs and speed up tests. No fixtures, no funny magic, just easy and fast plain old ruby.&quot;
   s.files        = [&quot;README.markdown&quot;, &quot;MIT-LICENSE&quot;, &quot;lib/machinery.rb&quot;, &quot;lib/machinery/active_record.rb&quot;]
   s.require_path = &quot;lib&quot;
   s.has_rdoc     = false</diff>
      <filename>machinery.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -10,30 +10,28 @@ describe Machinery, &quot;with earth ships only&quot; do
     @titanic.should_not be_nil
   end
 
-  it &quot;should be a ship&quot; do
+  it &quot;should be a @titanic ship&quot; do
     @titanic.should be_instance_of(Ship)
   end
 
-  it &quot;should not create @apollo&quot; do
-    @apollo.should be_nil
+  it &quot;should have the name Titanic&quot; do
+    @titanic.name.should == &quot;Titanic&quot;
   end
-end
 
-describe Machinery, &quot;with space ships only&quot; do
-  before(:each) do
-    scenario :space_ships
+  it &quot;should not create @apollo&quot; do
+    @apollo.should be_nil
   end
-
-  it &quot;should create @apollo&quot; do
-    @apollo.should_not be_nil
+  
+  it &quot;should not have any changed attributes for @titanic&quot; do
+    @titanic.changed?.should be_false
   end
 
-  it &quot;should be a ship&quot; do
-    @apollo.should be_instance_of(Ship)
+  it &quot;should not be a new @titanic&quot; do
+    @titanic.new_record?.should be_false
   end
-
-  it &quot;should not create @titanic&quot; do
-    @titanic.should be_nil
+  
+  it &quot;should be a new @voc&quot; do
+    @voc.new_record?.should be_true
   end
 end
 
@@ -185,7 +183,7 @@ describe Machinery, &quot;clone instances before each test&quot; do
   it &quot;should delete Titanic&quot; do
     #simulating spec/rails transactional fixtures: rollback after each example
     Ship.transaction do
-      @titanic.destroy
+      @titanic.destroy # this freezes @titanic
       Ship.find_by_name('Titanic').should be_nil
       raise ActiveRecord::Rollback
     end
@@ -196,6 +194,7 @@ describe Machinery, &quot;clone instances before each test&quot; do
   end
 
   it &quot;should not be frozen&quot; do
+    @titanic.frozen?.should be_false
     lambda { @titanic.name = &quot;Updated Titanic&quot; }.should_not raise_error
   end
 </diff>
      <filename>spec/machinery_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,28 +23,6 @@ class MachineryWithEarthShipsOnlyTest &lt; Test::Unit::TestCase
   end
 end
 
-class MachineryWithSpaceShipsOnlyTest &lt; Test::Unit::TestCase
-  def setup
-    scenario :space_ships
-  end
-
-  def teardown
-    rollback_scenarios
-  end
-
-  def test_should_create_apollo
-    assert(!@apollo.nil?)
-  end
-
-  def test_should_be_a_ship
-    assert(@apollo.is_a?(Ship))
-  end
-
-  def test_should_not_create_titanic
-    assert(@titanic.nil?)
-  end
-end
-
 class MachineryWithAllShipsTest &lt; Test::Unit::TestCase
   def setup
     scenario :all_ships</diff>
      <filename>spec/machinery_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 scenario :earth_ships do
   @titanic = Ship.create!(:name =&gt; &quot;Titanic&quot;)
   @pirates = Ship.create!(:name =&gt; &quot;Pirate&quot;)
+  @voc = Ship.new(:name =&gt; &quot;VOC&quot;)
 end
 
 scenario :space_ships do</diff>
      <filename>spec/scenarios.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5beaa0d9dc6512baf4da4bde979aac27df1d3867</id>
    </parent>
  </parents>
  <author>
    <name>Lawrence Pit</name>
    <email>lawrence.pit@gmail.com</email>
  </author>
  <url>http://github.com/lawrencepit/machinery/commit/5bd7d1314ee2ace1e9bf22339bc225cfbd616e24</url>
  <id>5bd7d1314ee2ace1e9bf22339bc225cfbd616e24</id>
  <committed-date>2009-11-02T02:29:02-08:00</committed-date>
  <authored-date>2009-11-02T02:29:02-08:00</authored-date>
  <message>Improved cloning AR objects.</message>
  <tree>3ae96aa67e32586133331ae3f5249d72f390cae2</tree>
  <committer>
    <name>Lawrence Pit</name>
    <email>lawrence.pit@gmail.com</email>
  </committer>
</commit>
