summaryrefslogtreecommitdiff
path: root/vendor/plugins/thinking-sphinx/spec/spec_helper.rb
diff options
context:
space:
mode:
authorUser <hukl@cccms.ccc.de>2011-02-10 14:23:36 +0100
committerUser <hukl@cccms.ccc.de>2011-02-10 14:23:36 +0100
commit384b187e9e067ddf2bb4d5fad0c2deaf96f69c89 (patch)
treecf743f377d3e2e28a31ae0359d95f37beba82cc3 /vendor/plugins/thinking-sphinx/spec/spec_helper.rb
parent3d0de09cf94cee6233b36a7f5ce20d5059854acc (diff)
parentcec2b1e2881db0000b2a09029154bea0fc62ade3 (diff)
Merge branch 'master' of ssh://svn.medienhaus.udk-berlin.de/usr/local/git/cccms
Diffstat (limited to 'vendor/plugins/thinking-sphinx/spec/spec_helper.rb')
-rw-r--r--vendor/plugins/thinking-sphinx/spec/spec_helper.rb56
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 6ebce6df..00000000
--- a/vendor/plugins/thinking-sphinx/spec/spec_helper.rb
+++ /dev/null
@@ -1,56 +0,0 @@
1$:.unshift File.dirname(__FILE__) + '/../lib'
2
3require 'rubygems'
4require 'fileutils'
5require 'ginger'
6
7require 'lib/thinking_sphinx'
8
9require 'not_a_mock'
10require 'will_paginate'
11
12require 'spec/sphinx_helper'
13
14ActiveRecord::Base.logger = Logger.new(StringIO.new)
15
16Spec::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
56end