Permalink
Browse files

Garlic for tests with multiple versions of Rails

  • Loading branch information...
1 parent 3a77340 commit 7498bbfb16487301e88866532cc1937723429dcc @stffn committed Oct 28, 2008
Showing with 36 additions and 1 deletion.
  1. +4 −0 .gitignore
  2. +11 −0 Rakefile
  3. +20 −0 garlic_example.rb
  4. +1 −1 test/test_helper.rb
View
@@ -0,0 +1,4 @@
+garlic.rb
+garlic
+nbproject
+rdoc
View
@@ -21,3 +21,14 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end
+
+# load up garlic if it's here
+if File.directory?(File.join(File.dirname(__FILE__), 'garlic'))
+ require File.join(File.dirname(__FILE__), 'garlic/lib/garlic_tasks')
+ require File.join(File.dirname(__FILE__), 'garlic')
+end
+
+desc "clone the garlic repo (for running ci tasks)"
+task :get_garlic do
+ sh "git clone git://github.com/ianwhite/garlic.git garlic"
+end
View
@@ -0,0 +1,20 @@
+garlic do
+ repo 'rails', :url => 'git://github.com/rails/rails'#, :local => "~/dev/vendor/rails"
+ repo 'declarative_authorization', :path => '.'
+
+ target 'edge'
+ target '2.1-stable', :branch => 'origin/2-1-stable'
+ #target '2.0.2', :tag => 'v2.0.2'
+
+ all_targets do
+ prepare do
+ plugin 'declarative_authorization', :clone => true
+ end
+
+ run do
+ cd "vendor/plugins/resources_controller" do
+ sh "rake"
+ end
+ end
+ end
+end
View
@@ -1,5 +1,5 @@
require 'test/unit'
-RAILS_ROOT = File.dirname(__FILE__) + '../../../../../'
+RAILS_ROOT = File.dirname(__FILE__) + '/../../../../'
require File.dirname(__FILE__) + '/../lib/authorization.rb'
require File.dirname(__FILE__) + '/../lib/in_controller.rb'

0 comments on commit 7498bbf

Please sign in to comment.