Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add travis support #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions .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

6 changes: 6 additions & 0 deletions Rakefile
@@ -0,0 +1,6 @@
require 'rubygems'
require 'rake'
require 'rspec/core/rake_task'

desc "Run all RSpec tests"
RSpec::Core::RakeTask.new(:spec)
13 changes: 13 additions & 0 deletions 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
13 changes: 13 additions & 0 deletions 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
13 changes: 13 additions & 0 deletions 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
10 changes: 7 additions & 3 deletions spec/database.rb
Expand Up @@ -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?

Expand Down
2 changes: 1 addition & 1 deletion spec/job_spec.rb
Expand Up @@ -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
Expand Down