Skip to content

Commit

Permalink
Added .travis.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
assaf committed Aug 1, 2011
1 parent 20daeb4 commit 9aee776
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
rvm:
- 1.8.7
- 1.9.2
gemfile:
- Gemfile
- Rails2
- Rails3
env:
- DB=rack-oauth2-server
notifications:
recipients:
- [email protected]
26 changes: 18 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,32 @@ namespace :test do
task :all=>["test:sinatra", "test:rails2", "test:rails3"]
desc "Run all tests against Sinatra"
task :sinatra do
sh "rake test FRAMEWORK=sinatra"
end
desc "Run all tests against Rails"
task :rails do
sh "rake test FRAMEWORK=rails"
sh "env BUNDLE_GEMFILE=Gemfile bundle exec rake"
end
desc "Run all tests against Rails 2.3.x"
task :rails2 do
sh "env BUNDLE_GEMFILE=Rails2 rake test FRAMEWORK=rails"
sh "env BUNDLE_GEMFILE=Rails2 bundle exec rake"
end
desc "Run all tests against Rails 3.x"
task :rails3 do
sh "env BUNDLE_GEMFILE=Rails3 bundle exec rake test FRAMEWORK=rails"
sh "env BUNDLE_GEMFILE=Rails3 bundle exec rake"
end
end
task :default=>"test:all"

task :default do
ENV["FRAMEWORK"] = "rails"
begin
require "rails" # check for Rails3
rescue LoadError
begin
require "initializer" # check for Rails2
rescue LoadError
ENV["FRAMEWORK"] = "sinatra"
end
end
task("test").invoke
end


begin
require "yard"
Expand Down
3 changes: 2 additions & 1 deletion test/setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@


ENV["RACK_ENV"] = "test"
DATABASE = Mongo::Connection.new["test"]
ENV["DB"] = "test"
DATABASE = Mongo::Connection.new[ENV["DB"]]
FRAMEWORK = ENV["FRAMEWORK"] || "sinatra"


Expand Down

0 comments on commit 9aee776

Please sign in to comment.