aboutsummaryrefslogtreecommitdiffstats
path: root/lib/strip_attributes/test/test_helper.rb
diff options
context:
space:
mode:
authorMark Longair <mhl@pobox.com>2013-11-28 14:36:36 +0000
committerMark Longair <mhl@pobox.com>2013-11-29 12:22:59 +0000
commit600c3b356d804546bfa31fef89979cc1c44f3756 (patch)
treea2e45e35346601236fb92bff70a56989d9161f62 /lib/strip_attributes/test/test_helper.rb
parent20089cf7b5045d504b7240bc92e2b6068fcc2246 (diff)
Move strip_attributes out of vendor/plugins
Diffstat (limited to 'lib/strip_attributes/test/test_helper.rb')
-rw-r--r--lib/strip_attributes/test/test_helper.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/strip_attributes/test/test_helper.rb b/lib/strip_attributes/test/test_helper.rb
new file mode 100644
index 000000000..7d06c40db
--- /dev/null
+++ b/lib/strip_attributes/test/test_helper.rb
@@ -0,0 +1,20 @@
+require 'test/unit'
+require 'rubygems'
+require 'active_record'
+
+PLUGIN_ROOT = File.expand_path(File.join(File.dirname(__FILE__), ".."))
+
+$LOAD_PATH.unshift "#{PLUGIN_ROOT}/lib"
+require "#{PLUGIN_ROOT}/init"
+
+class ActiveRecord::Base
+ alias_method :save, :valid?
+ def self.columns()
+ @columns ||= []
+ end
+
+ def self.column(name, sql_type = nil, default = nil, null = true)
+ @columns ||= []
+ @columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type, null)
+ end
+end