From 7379daad1c73bd3610ed296436250b417ac3673d Mon Sep 17 00:00:00 2001 From: hukl Date: Thu, 10 Feb 2011 14:19:00 +0100 Subject: removed thinking_sphinx plugin and replaced it with gem. also tuned dependencies --- .../spec/unit/thinking_sphinx_spec.rb | 133 --------------------- 1 file changed, 133 deletions(-) delete mode 100644 vendor/plugins/thinking-sphinx/spec/unit/thinking_sphinx_spec.rb (limited to 'vendor/plugins/thinking-sphinx/spec/unit/thinking_sphinx_spec.rb') diff --git a/vendor/plugins/thinking-sphinx/spec/unit/thinking_sphinx_spec.rb b/vendor/plugins/thinking-sphinx/spec/unit/thinking_sphinx_spec.rb deleted file mode 100644 index 375e158e..00000000 --- a/vendor/plugins/thinking-sphinx/spec/unit/thinking_sphinx_spec.rb +++ /dev/null @@ -1,133 +0,0 @@ -require 'spec/spec_helper' - -describe ThinkingSphinx do - it "should define indexes by default" do - ThinkingSphinx.define_indexes?.should be_true - end - - it "should disable index definition" do - ThinkingSphinx.define_indexes = false - ThinkingSphinx.define_indexes?.should be_false - end - - it "should enable index definition" do - ThinkingSphinx.define_indexes = false - ThinkingSphinx.define_indexes?.should be_false - ThinkingSphinx.define_indexes = true - ThinkingSphinx.define_indexes?.should be_true - end - - it "should index deltas by default" do - ThinkingSphinx.deltas_enabled = nil - ThinkingSphinx.deltas_enabled?.should be_true - end - - it "should disable delta indexing" do - ThinkingSphinx.deltas_enabled = false - ThinkingSphinx.deltas_enabled?.should be_false - end - - it "should enable delta indexing" do - ThinkingSphinx.deltas_enabled = false - ThinkingSphinx.deltas_enabled?.should be_false - ThinkingSphinx.deltas_enabled = true - ThinkingSphinx.deltas_enabled?.should be_true - end - - it "should update indexes by default" do - ThinkingSphinx.updates_enabled = nil - ThinkingSphinx.updates_enabled?.should be_true - end - - it "should disable index updating" do - ThinkingSphinx.updates_enabled = false - ThinkingSphinx.updates_enabled?.should be_false - end - - it "should enable index updating" do - ThinkingSphinx.updates_enabled = false - ThinkingSphinx.updates_enabled?.should be_false - ThinkingSphinx.updates_enabled = true - ThinkingSphinx.updates_enabled?.should be_true - end - - describe "use_group_by_shortcut? method" do - before :each do - adapter = defined?(JRUBY_VERSION) ? :JdbcAdapter : :MysqlAdapter - unless ::ActiveRecord::ConnectionAdapters.const_defined?(adapter) - pending "No MySQL" - return - end - - @connection = ::ActiveRecord::ConnectionAdapters.const_get(adapter).stub_instance( - :select_all => true, - :config => {:adapter => defined?(JRUBY_VERSION) ? 'jdbcmysql' : 'mysql'} - ) - ::ActiveRecord::Base.stub_method( - :connection => @connection - ) - end - - it "should return true if no ONLY_FULL_GROUP_BY" do - @connection.stub_method( - :select_all => {:a => "OTHER SETTINGS"} - ) - - ThinkingSphinx.use_group_by_shortcut?.should be_true - end - - it "should return true if NULL value" do - @connection.stub_method( - :select_all => {:a => nil} - ) - - ThinkingSphinx.use_group_by_shortcut?.should be_true - end - - it "should return false if ONLY_FULL_GROUP_BY is set" do - @connection.stub_method( - :select_all => {:a => "OTHER SETTINGS,ONLY_FULL_GROUP_BY,blah"} - ) - - ThinkingSphinx.use_group_by_shortcut?.should be_false - end - - it "should return false if ONLY_FULL_GROUP_BY is set in any of the values" do - @connection.stub_method( - :select_all => { - :a => "OTHER SETTINGS", - :b => "ONLY_FULL_GROUP_BY" - } - ) - - ThinkingSphinx.use_group_by_shortcut?.should be_false - end - - describe "if not using MySQL" do - before :each do - adapter = defined?(JRUBY_VERSION) ? :JdbcAdapter : :PostgreSQLAdapter - unless ::ActiveRecord::ConnectionAdapters.const_defined?(adapter) - pending "No PostgreSQL" - return - end - @connection = ::ActiveRecord::ConnectionAdapters.const_get(adapter).stub_instance( - :select_all => true, - :config => {:adapter => defined?(JRUBY_VERSION) ? 'jdbcpostgresql' : 'postgresql'} - ) - ::ActiveRecord::Base.stub_method( - :connection => @connection - ) - end - - it "should return false" do - ThinkingSphinx.use_group_by_shortcut?.should be_false - end - - it "should not call select_all" do - ThinkingSphinx.use_group_by_shortcut? - - @connection.should_not have_received(:select_all) - end - end - end -end -- cgit v1.3