diff options
Diffstat (limited to 'vendor/plugins/thinking-sphinx/spec/spec_helper.rb')
| -rw-r--r-- | vendor/plugins/thinking-sphinx/spec/spec_helper.rb | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/vendor/plugins/thinking-sphinx/spec/spec_helper.rb b/vendor/plugins/thinking-sphinx/spec/spec_helper.rb deleted file mode 100644 index 6ebce6d..0000000 --- a/vendor/plugins/thinking-sphinx/spec/spec_helper.rb +++ /dev/null | |||
| @@ -1,56 +0,0 @@ | |||
| 1 | $:.unshift File.dirname(__FILE__) + '/../lib' | ||
| 2 | |||
| 3 | require 'rubygems' | ||
| 4 | require 'fileutils' | ||
| 5 | require 'ginger' | ||
| 6 | |||
| 7 | require 'lib/thinking_sphinx' | ||
| 8 | |||
| 9 | require 'not_a_mock' | ||
| 10 | require 'will_paginate' | ||
| 11 | |||
| 12 | require 'spec/sphinx_helper' | ||
| 13 | |||
| 14 | ActiveRecord::Base.logger = Logger.new(StringIO.new) | ||
| 15 | |||
| 16 | Spec::Runner.configure do |config| | ||
| 17 | %w( tmp tmp/config tmp/log tmp/db ).each do |path| | ||
| 18 | FileUtils.mkdir_p "#{Dir.pwd}/#{path}" | ||
| 19 | end | ||
| 20 | |||
| 21 | Kernel.const_set :RAILS_ROOT, "#{Dir.pwd}/tmp" unless defined?(RAILS_ROOT) | ||
| 22 | |||
| 23 | sphinx = SphinxHelper.new | ||
| 24 | sphinx.setup_mysql | ||
| 25 | |||
| 26 | require 'spec/fixtures/models' | ||
| 27 | |||
| 28 | config.before :all do | ||
| 29 | %w( tmp tmp/config tmp/log tmp/db ).each do |path| | ||
| 30 | FileUtils.mkdir_p "#{Dir.pwd}/#{path}" | ||
| 31 | end | ||
| 32 | |||
| 33 | ThinkingSphinx.updates_enabled = true | ||
| 34 | ThinkingSphinx.deltas_enabled = true | ||
| 35 | ThinkingSphinx.suppress_delta_output = true | ||
| 36 | |||
| 37 | ThinkingSphinx::Configuration.instance.reset | ||
| 38 | ThinkingSphinx::Configuration.instance.database_yml_file = "spec/fixtures/sphinx/database.yml" | ||
| 39 | |||
| 40 | # Ensure after_commit plugin is loaded correctly | ||
| 41 | Object.subclasses_of(ActiveRecord::ConnectionAdapters::AbstractAdapter).each { |klass| | ||
| 42 | unless klass.ancestors.include?(AfterCommit::ConnectionAdapters) | ||
| 43 | klass.send(:include, AfterCommit::ConnectionAdapters) | ||
| 44 | end | ||
| 45 | } | ||
| 46 | end | ||
| 47 | |||
| 48 | config.after :each do | ||
| 49 | NotAMock::CallRecorder.instance.reset | ||
| 50 | NotAMock::Stubber.instance.reset | ||
| 51 | end | ||
| 52 | |||
| 53 | config.after :all do | ||
| 54 | FileUtils.rm_r "#{Dir.pwd}/tmp" rescue nil | ||
| 55 | end | ||
| 56 | end | ||
