Skip to content

Add travis support #47

Open
wants to merge 1 commit into from
View
13 .travis.yml
@@ -0,0 +1,13 @@
+script: "bundle exec rake spec"
+
+rvm:
+ - 1.8.7
+ - 1.9.2
+ - jruby
+ - rbx-2.0
+
+gemfile:
+ - gemfiles/Gemfile-activerecord-2.3
+ - gemfiles/Gemfile-activerecord-3.0
+ - gemfiles/Gemfile-activerecord-3.1
+
View
6 Rakefile
@@ -0,0 +1,6 @@
+require 'rubygems'
+require 'rake'
+require 'rspec/core/rake_task'
+
+desc "Run all RSpec tests"
+RSpec::Core::RakeTask.new(:spec)
View
13 gemfiles/Gemfile-activerecord-2.3
@@ -0,0 +1,13 @@
+source :rubygems
+
+
+group :test do
+ gem 'rake' , '~> 0.9.2'
+ if defined?(JRUBY_VERSION)
+ gem 'activerecord-jdbcsqlite3-adapter'
+ else
+ gem "sqlite3-ruby", "~> 1.3.3"
+ end
+ gem "rspec" , "~> 2.6.0"
+ gem "activerecord", "~> 2.3.14"
+end
View
13 gemfiles/Gemfile-activerecord-3.0
@@ -0,0 +1,13 @@
+source :rubygems
+
+
+group :test do
+ gem 'rake' , '~> 0.9.2'
+ if defined?(JRUBY_VERSION)
+ gem 'activerecord-jdbcsqlite3-adapter'
+ else
+ gem "sqlite3-ruby", "~> 1.3.3"
+ end
+ gem "rspec" , "~> 2.6.0"
+ gem "activerecord", "~> 3.0.10"
+end
View
13 gemfiles/Gemfile-activerecord-3.1
@@ -0,0 +1,13 @@
+source :rubygems
+
+
+group :test do
+ gem 'rake' , '~> 0.9.2'
+ if defined?(JRUBY_VERSION)
+ gem 'activerecord-jdbcsqlite3-adapter'
+ else
+ gem "sqlite3-ruby", "~> 1.3.3"
+ end
+ gem "rspec" , "~> 2.6.0"
+ gem "activerecord", "~> 3.1.0.rc6"
+end
View
10 spec/database.rb
@@ -3,13 +3,17 @@
require 'rubygems'
require 'active_record'
-gem 'sqlite3-ruby'
+unless ENV['TRAVIS']
+ gem 'sqlite3-ruby'
+end
require File.dirname(__FILE__) + '/../init'
-require 'spec'
+require 'rspec'
+require 'logger'
ActiveRecord::Base.logger = Logger.new('/tmp/dj.log')
-ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => '/tmp/jobs.sqlite')
+ActiveRecord::Base.establish_connection(:adapter => defined?(JRUBY_VERSION) ? 'jdbcsqlite3' : 'sqlite3', :database => '/tmp/jobs.sqlite')
+
ActiveRecord::Migration.verbose = false
ActiveRecord::Base.default_timezone = :utc if Time.zone.nil?
View
2 spec/job_spec.rb
@@ -58,7 +58,7 @@ def perform; @@runs += 1; end
Delayed::Job.enqueue SimpleJob.new, 5, later
# use be close rather than equal to because millisecond values cn be lost in DB round trip
- Delayed::Job.first.run_at.should be_close(later, 1)
+ Delayed::Job.first.run_at.should be_within(1).of(later)
end
it "should call perform on jobs when running work_off" do
Something went wrong with that request. Please try again.