From 78ad0c16bb492561c98f22fdb435aa064224ee4d Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Tue, 25 Dec 2012 22:56:05 -0300 Subject: [PATCH] Remove more solr stuff --- test/test_helper.rb | 8 -------- test/test_solr_helper.rb | 50 -------------------------------------------------- 2 files changed, 0 insertions(+), 58 deletions(-) delete mode 100644 test/test_solr_helper.rb diff --git a/test/test_helper.rb b/test/test_helper.rb index 90d145c..58f84fa 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,12 +1,5 @@ ENV["RAILS_ENV"] = "test" -# Start/stop Solr -if not $test_helper_loaded - abort unless system 'rake -s solr:start' - at_exit { system 'rake -s solr:stop' } - $test_helper_loaded = true -end - require File.expand_path(File.dirname(__FILE__) + "/../config/environment") require 'test_help' require 'mocha' @@ -17,7 +10,6 @@ require 'noosfero/test' require File.dirname(__FILE__) + '/factories' require File.dirname(__FILE__) + '/noosfero_doc_test' require File.dirname(__FILE__) + '/action_tracker_test_helper' -require File.expand_path(File.dirname(__FILE__) + "/test_solr_helper.rb") FileUtils.rm_rf(File.join(Rails.root, 'index', 'test')) diff --git a/test/test_solr_helper.rb b/test/test_solr_helper.rb deleted file mode 100644 index 9e77e27..0000000 --- a/test/test_solr_helper.rb +++ /dev/null @@ -1,50 +0,0 @@ -class ActsAsSolr::Post - class << self - alias_method :execute_orig, :execute - end -end -module ActsAsSolr::ParserMethods - alias_method :parse_results_orig, :parse_results -end - -class TestSolr - - def self.enable - ActsAsSolr::Post.class_eval do - def self.execute(*args) - execute_orig *args - end - end - ActsAsSolr::ParserMethods.module_eval do - def parse_results(*args) - parse_results_orig *args - end - end - - # clear index - ActsAsSolr::Post.execute(Solr::Request::Delete.new(:query => '*:*')) - - @solr_disabled = false - end - - def self.disable - return if @solr_disabled - - ActsAsSolr::Post.class_eval do - def self.execute(*args) - true - end - end - ActsAsSolr::ParserMethods.module_eval do - def parse_results(*args) - parse_results_orig nil, args[1] - end - end - - @solr_disabled = true - end - -end - -# disable solr actions by default -TestSolr.disable -- libgit2 0.21.2