Skip to content

Commit

Permalink
@BugFix execute tests with any version of resque_unit
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroig authored and angelf committed Jan 7, 2011
1 parent 92bf7ab commit e6f8acd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/distributed_index_creation_test.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'test_helper'
require 'resque_unit'

require File.dirname(__FILE__) + '/test_helper.rb'

Expand All @@ -9,6 +8,7 @@
class DistributedIndexCreation < Test::Unit::TestCase

load_schema
resque_available
class User < ActiveRecord::Base
elastic_index :updates => false
end
Expand Down
4 changes: 2 additions & 2 deletions test/nrt_enqueue_test.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# tests the Near Real Time support in the :updates => true mode

require 'test_helper'
require 'resque_unit'


require File.dirname(__FILE__) + '/test_helper.rb'

class NrtEnqueue < Test::Unit::TestCase
load_schema
resque_available

class User < ActiveRecord::Base
elastic_index :updates => :enqueue
end

def setup
Resque.reset!
User.delete_all
Escargot::LocalIndexing.create_index_for_model(User)

Expand Down
1 change: 1 addition & 0 deletions test/nrt_immediate_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

class NrtImmediate < Test::Unit::TestCase
load_schema
resque_available

class User < ActiveRecord::Base
elastic_index
Expand Down
1 change: 1 addition & 0 deletions test/nrt_immediate_with_refresh_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

class NrtImmediateWithRefreshTest < Test::Unit::TestCase
load_schema
resque_available

class User < ActiveRecord::Base
elastic_index :updates => :immediate_with_refresh
Expand Down
3 changes: 2 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ def load_schema

def resque_available
begin
Resque
require 'resque'
require 'resque_unit'
Resque.reset!
return true
rescue NameError, MissingSourceFile
puts "Please install the 'resque' and 'resque_unit' gems to test the distributed mode."
Expand Down

0 comments on commit e6f8acd

Please sign in to comment.