mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Test haml & sass against multiple versions of rails.
This commit is contained in:
parent
03f1d9a57b
commit
74d8a56278
2 changed files with 46 additions and 1 deletions
36
Rakefile
36
Rakefile
|
@ -13,7 +13,11 @@ end
|
|||
|
||||
# ----- Default: Testing ------
|
||||
|
||||
task :default => :test
|
||||
if ENV["RUN_CODE_RUN"] == "true"
|
||||
task :default => :"test:rails_compatibility"
|
||||
else
|
||||
task :default => :test
|
||||
end
|
||||
|
||||
require 'rake/testtask'
|
||||
|
||||
|
@ -148,3 +152,33 @@ END
|
|||
RubyProf.const_get("#{(ENV['OUTPUT'] || 'Flat').capitalize}Printer").new(result).print
|
||||
end
|
||||
rescue LoadError; end
|
||||
|
||||
# ----- Testing Multiple Rails Versions -----
|
||||
|
||||
rails_versions = [
|
||||
"v2.3.0",
|
||||
"v2.2.2",
|
||||
"v2.1.2",
|
||||
"v2.0.5"
|
||||
]
|
||||
|
||||
namespace :test do
|
||||
desc "Test all supported versions of rails. This takes a while."
|
||||
task :rails_compatibility do
|
||||
`rm -rf test/rails`
|
||||
puts "Checking out rails. Please wait."
|
||||
`git clone git://github.com/rails/rails.git test/rails` rescue nil
|
||||
begin
|
||||
rails_versions.each do |version|
|
||||
Dir.chdir "test/rails" do
|
||||
`git checkout #{version}`
|
||||
end
|
||||
puts "Testing Rails #{version}"
|
||||
Rake::Task['test'].reenable
|
||||
Rake::Task['test'].execute
|
||||
end
|
||||
ensure
|
||||
`rm -rf test/rails`
|
||||
end
|
||||
end
|
||||
end
|
|
@ -20,7 +20,18 @@ module Haml::Helpers
|
|||
end
|
||||
end
|
||||
|
||||
class Egocentic
|
||||
def method_missing(*args)
|
||||
self
|
||||
end
|
||||
end
|
||||
|
||||
class DummyController
|
||||
attr_accessor :logger
|
||||
def initialize
|
||||
@logger = Egocentic.new
|
||||
end
|
||||
|
||||
def self.controller_path
|
||||
''
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue