aboutsummaryrefslogtreecommitdiffstats
path: root/lib/strip_attributes/test/test_helper.rb
diff options
context:
space:
mode:
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