forked from tobi/delayed_job
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to the backend test structure
* Moved specific backend tests to a backend directory * Conditionally testing mongo adapter * Renamed mongo to mongo_mapper since there are other mongo ORMs
- Loading branch information
Showing
14 changed files
with
98 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,4 +59,4 @@ def dump(obj) | |
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
require 'spec_helper' | ||
require 'delayed/backend/active_record' | ||
|
||
describe Delayed::Job do | ||
before(:all) do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require 'active_record' | ||
|
||
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:') | ||
ActiveRecord::Base.logger = DELAYED_JOB_LOGGER | ||
ActiveRecord::Migration.verbose = false | ||
|
||
ActiveRecord::Schema.define do | ||
|
||
create_table :delayed_jobs, :force => true do |table| | ||
table.integer :priority, :default => 0 | ||
table.integer :attempts, :default => 0 | ||
table.text :handler | ||
table.string :last_error | ||
table.datetime :run_at | ||
table.datetime :locked_at | ||
table.string :locked_by | ||
table.datetime :failed_at | ||
table.timestamps | ||
end | ||
|
||
create_table :stories, :force => true do |table| | ||
table.string :text | ||
end | ||
|
||
end | ||
|
||
# Purely useful for test cases... | ||
class Story < ActiveRecord::Base | ||
def tell; text; end | ||
def whatever(n, _); tell*n; end | ||
|
||
handle_asynchronously :whatever | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
MongoMapper.connection = Mongo::Connection.new nil, nil, :logger => DELAYED_JOB_LOGGER | ||
MongoMapper.database = 'delayed_job' | ||
|
||
unless defined?(Story) | ||
class Story | ||
include ::MongoMapper::Document | ||
def tell; text; end | ||
def whatever(n, _); tell*n; end | ||
def self.count; end | ||
|
||
handle_asynchronously :whatever | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters