spec/unit/thinking_sphinx/configuration_spec.rb in freelancing-god-thinking-sphinx-1.1.21 vs spec/unit/thinking_sphinx/configuration_spec.rb in freelancing-god-thinking-sphinx-1.1.22
- old
+ new
@@ -10,11 +10,11 @@
it "should use the Merb environment value if set" do
unless defined?(Merb)
module ::Merb; end
end
-
+
ThinkingSphinx::Configuration.stub_method(:defined? => true)
Merb.stub!(:environment => "merb_production")
ThinkingSphinx::Configuration.environment.should == "merb_production"
Object.send(:remove_const, :Merb)
@@ -46,11 +46,13 @@
"mem_limit" => "128M",
"max_matches" => 1001,
"morphology" => "stem_ru",
"charset_type" => "latin1",
"charset_table" => "table",
- "ignore_chars" => "e"
+ "ignore_chars" => "e",
+ "searchd_binary_name" => "sphinx-searchd",
+ "indexer_binary_name" => "sphinx-indexer"
}
}
open("#{RAILS_ROOT}/config/sphinx.yml", "w") do |f|
f.write YAML.dump(@settings)
@@ -60,11 +62,11 @@
it "should use the accessors to set the configuration values" do
config = ThinkingSphinx::Configuration.instance
config.send(:parse_config)
%w(config_file searchd_log_file query_log_file pid_file searchd_file_path
- address port).each do |key|
+ address port searchd_binary_name indexer_binary_name).each do |key|
config.send(key).should == @settings["development"][key]
end
end
after :each do
@@ -215,6 +217,6 @@
file = open(ThinkingSphinx::Configuration.instance.config_file) { |f|
f.read
}
file.should_not match(/index alpha_core\s+\{\s+[^\}]*prefix_fields\s+=[^\}]*\}/m)
end
-end
\ No newline at end of file
+end