<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.autotest</filename>
    </added>
    <added>
      <filename>test/test_helper.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,221 +1,5 @@
-require 'test/unit'
-require File.join(File.dirname(__FILE__), '../lib/permalink_fu')
-
-begin
-  require 'rubygems'
-  require 'ruby-debug'
-  Debugger.start
-rescue LoadError
-  puts &quot;no ruby debugger&quot;
-end
-
-gem 'activesupport'
-require 'active_support/core_ext/blank'
-
-class FauxColumn &lt; Struct.new(:limit)
-end
-
-class BaseModel
-  def self.columns_hash
-    @columns_hash ||= {'permalink' =&gt; FauxColumn.new(100)}
-  end
-
-  def self.inherited(base)
-    subclasses &lt;&lt; base
-  end
-
-  extend PermalinkFu::PluginMethods
-  attr_accessor :id
-  attr_accessor :title
-  attr_accessor :extra
-  attr_reader   :permalink
-  attr_accessor :foo
-
-  class &lt;&lt; self
-    attr_accessor :validation, :subclasses
-  end
-  self.subclasses = []
-
-  def self.generated_methods
-    @generated_methods ||= []
-  end
-  
-  def self.primary_key
-    :id
-  end
-  
-  def self.logger
-    nil
-  end
-
-  def self.define_attribute_methods
-    return unless generated_methods.empty?
-    true
-  end
-
-  # ripped from AR
-  def self.evaluate_attribute_method(attr_name, method_definition, method_name=attr_name)
-
-    unless method_name.to_s == primary_key.to_s
-      generated_methods &lt;&lt; method_name
-    end
-
-    begin
-      class_eval(method_definition, __FILE__, __LINE__)
-    rescue SyntaxError =&gt; err
-      generated_methods.delete(attr_name)
-      if logger
-        logger.warn &quot;Exception occurred during reader method compilation.&quot;
-        logger.warn &quot;Maybe #{attr_name} is not a valid Ruby identifier?&quot;
-        logger.warn &quot;#{err.message}&quot;
-      end
-    end
-  end
-
-  def self.exists?(*args)
-    false
-  end
-
-  def self.before_validation(method)
-    self.validation = method
-  end
-
-  def validate
-    send self.class.validation if self.class.validation
-    permalink
-  end
-  
-  def new_record?
-    @id.nil?
-  end
-  
-  def write_attribute(key, value)
-    instance_variable_set &quot;@#{key}&quot;, value
-  end
-  
-  def read_attribute(key)
-    instance_variable_get &quot;@#{key}&quot;
-  end
-end
-
-class MockModel &lt; BaseModel
-  def self.exists?(conditions)
-    if conditions[1] == 'foo'   || conditions[1] == 'bar' || 
-      (conditions[1] == 'bar-2' &amp;&amp; conditions[2] != 2)
-      true
-    else
-      false
-    end
-  end
-
-  has_permalink :title
-end
-
-class PermalinkChangeableMockModel &lt; BaseModel
-  def self.exists?(conditions)
-    if conditions[1] == 'foo'
-      true
-    else
-      false
-    end
-  end
-
-  has_permalink :title
-
-  def permalink_changed?
-    @permalink_changed
-  end
-
-  def permalink_will_change!
-    @permalink_changed = true
-  end
-end
-
-class CommonMockModel &lt; BaseModel
-  def self.exists?(conditions)
-    false # oh noes
-  end
-
-  has_permalink :title, :unique =&gt; false
-end
-
-class ScopedModel &lt; BaseModel
-  def self.exists?(conditions)
-    if conditions[1] == 'foo' &amp;&amp; conditions[2] != 5
-      true
-    else
-      false
-    end
-  end
-
-  has_permalink :title, :scope =&gt; :foo
-end
-
-class ScopedModelForNilScope &lt; BaseModel
-  def self.exists?(conditions)
-    (conditions[0] == 'permalink = ? and foo IS NULL') ? (conditions[1] == 'ack') : false
-  end
-
-  has_permalink :title, :scope =&gt; :foo
-end
-
-class OverrideModel &lt; BaseModel
-  has_permalink :title
-  
-  def permalink
-    'not the permalink'
-  end
-end
-
-class ChangedWithoutUpdateModel &lt; BaseModel
-  has_permalink :title  
-  def title_changed?; true; end
-end
-
-class ChangedWithUpdateModel &lt; BaseModel
-  has_permalink :title, :update =&gt; true 
-  def title_changed?; true; end
-end
-
-class NoChangeModel &lt; BaseModel
-  has_permalink :title, :update =&gt; true
-  def title_changed?; false; end
-end
-
-class IfProcConditionModel &lt; BaseModel
-  has_permalink :title, :if =&gt; Proc.new { |obj| false }
-end
-
-class IfMethodConditionModel &lt; BaseModel
-  has_permalink :title, :if =&gt; :false_method
-  
-  def false_method; false; end
-end
-
-class IfStringConditionModel &lt; BaseModel
-  has_permalink :title, :if =&gt; 'false'
-end
-
-class UnlessProcConditionModel &lt; BaseModel
-  has_permalink :title, :unless =&gt; Proc.new { |obj| false }
-end
-
-class UnlessMethodConditionModel &lt; BaseModel
-  has_permalink :title, :unless =&gt; :false_method
-  
-  def false_method; false; end
-end
-
-class UnlessStringConditionModel &lt; BaseModel
-  has_permalink :title, :unless =&gt; 'false'
-end
-
-class MockModelExtra &lt; BaseModel
-  has_permalink [:title, :extra]
-end
-
-# trying to be like ActiveRecord, define the attribute methods manually
-BaseModel.subclasses.each { |c| c.send :define_attribute_methods }
+# encoding: UTF-8
+require File.join(File.dirname(__FILE__), 'test_helper')
 
 class PermalinkFuTest &lt; Test::Unit::TestCase
   @@samples = {</diff>
      <filename>test/permalink_fu_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>62e06d75334490503d6b3d6d06d51ebaf286b62a</id>
    </parent>
  </parents>
  <author>
    <name>Adam Salter</name>
    <email>adam@codebright.net</email>
  </author>
  <url>http://github.com/technoweenie/permalink_fu/commit/123a33974a028a0494a52cdf0ac548d96abb5403</url>
  <id>123a33974a028a0494a52cdf0ac548d96abb5403</id>
  <committed-date>2009-08-26T22:41:36-07:00</committed-date>
  <authored-date>2009-08-26T22:41:36-07:00</authored-date>
  <message>- refactor tests and add autotest initializer</message>
  <tree>78f853d2db6d776a0a763a91ada74fd1b3a275f4</tree>
  <committer>
    <name>Adam Salter</name>
    <email>adam@codebright.net</email>
  </committer>
</commit>
