Skip to content

Commit

Permalink
Merge pull request #91 from dvandersluis/fix-spec-failures
Browse files Browse the repository at this point in the history
Fix some spec failures
  • Loading branch information
pat committed Feb 18, 2015
2 parents 5fc3823 + 8b48c86 commit a9096ea
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion spec/functional/escaping_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def sphinxql_matching(string)
it "escapes #{string}" do
lambda {
connection.query sphinxql_matching(Riddle::Query.escape(string))
}.should_not raise_error(Mysql2::Error)
}.should_not raise_error
end
end

Expand Down
24 changes: 12 additions & 12 deletions spec/riddle/auto_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
describe '.configure' do
before :each do
@controller = Riddle::Controller.new stub('configuration'), 'sphinx.conf'
Riddle::Controller.stub!(:new => @controller)
Riddle::Controller.stub(:new => @controller)

unless ENV['SPHINX_VERSION'].nil?
@env_version, ENV['SPHINX_VERSION'] = ENV['SPHINX_VERSION'].dup, nil
Expand All @@ -18,77 +18,77 @@
it "should require 0.9.8 if that is the known version" do
Riddle::AutoVersion.should_receive(:require).with('riddle/0.9.8')

@controller.stub!(:sphinx_version => '0.9.8')
@controller.stub(:sphinx_version => '0.9.8')
Riddle::AutoVersion.configure
end

it "should require 0.9.9 if that is the known version" do
Riddle::AutoVersion.should_receive(:require).with('riddle/0.9.9')

@controller.stub!(:sphinx_version => '0.9.9')
@controller.stub(:sphinx_version => '0.9.9')
Riddle::AutoVersion.configure
end

it "should require 1.10 if that is the known version" do
Riddle::AutoVersion.should_receive(:require).with('riddle/1.10')

@controller.stub!(:sphinx_version => '1.10-beta')
@controller.stub(:sphinx_version => '1.10-beta')
Riddle::AutoVersion.configure
end

it "should require 1.10 if using 1.10 with 64 bit IDs" do
Riddle::AutoVersion.should_receive(:require).with('riddle/1.10')

@controller.stub!(:sphinx_version => '1.10-id64-beta')
@controller.stub(:sphinx_version => '1.10-id64-beta')
Riddle::AutoVersion.configure
end

it "should require 2.0.1 if that is the known version" do
Riddle::AutoVersion.should_receive(:require).with('riddle/2.0.1')

@controller.stub!(:sphinx_version => '2.0.1-beta')
@controller.stub(:sphinx_version => '2.0.1-beta')
Riddle::AutoVersion.configure
end

it "should require 2.0.1 if 2.0.2-dev is being used" do
Riddle::AutoVersion.should_receive(:require).with('riddle/2.0.1')

@controller.stub!(:sphinx_version => '2.0.2-dev')
@controller.stub(:sphinx_version => '2.0.2-dev')
Riddle::AutoVersion.configure
end

it "should require 2.1.0 if 2.0.3 is being used" do
Riddle::AutoVersion.should_receive(:require).with('riddle/2.1.0')

@controller.stub!(:sphinx_version => '2.0.3-release')
@controller.stub(:sphinx_version => '2.0.3-release')
Riddle::AutoVersion.configure
end

it "should require 2.1.0 if 2.0.4 is being used" do
Riddle::AutoVersion.should_receive(:require).with('riddle/2.1.0')

@controller.stub!(:sphinx_version => '2.0.4-release')
@controller.stub(:sphinx_version => '2.0.4-release')
Riddle::AutoVersion.configure
end

it "should require 2.1.0 if 2.0.5 is being used" do
Riddle::AutoVersion.should_receive(:require).with('riddle/2.1.0')

@controller.stub!(:sphinx_version => '2.0.5-release')
@controller.stub(:sphinx_version => '2.0.5-release')
Riddle::AutoVersion.configure
end

it "should require 2.1.0 if 2.2.1 is being used" do
Riddle::AutoVersion.should_receive(:require).with('riddle/2.1.0')

@controller.stub!(:sphinx_version => '2.2.1-beta')
@controller.stub(:sphinx_version => '2.2.1-beta')
Riddle::AutoVersion.configure
end

it "should require 2.1.0 if that is the known version" do
Riddle::AutoVersion.should_receive(:require).with('riddle/2.1.0')

@controller.stub!(:sphinx_version => '2.1.0-dev')
@controller.stub(:sphinx_version => '2.1.0-dev')
Riddle::AutoVersion.configure
end
end
Expand Down
12 changes: 6 additions & 6 deletions spec/riddle/controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@
end

it "should return 1.10 if using 1.10-beta" do
@controller.stub!(:` => 'Sphinx 1.10-beta (r2420)')
@controller.stub(:` => 'Sphinx 1.10-beta (r2420)')
@controller.sphinx_version.should == '1.10-beta'
end

it "should return 0.9.9 if using 0.9.9" do
@controller.stub!(:` => 'Sphinx 0.9.9-release (r2117)')
@controller.stub(:` => 'Sphinx 0.9.9-release (r2117)')
@controller.sphinx_version.should == '0.9.9'
end

it "should return 0.9.9 if using 0.9.9 rc2" do
@controller.stub!(:` => 'Sphinx 0.9.9-rc2 (r1785)')
@controller.stub(:` => 'Sphinx 0.9.9-rc2 (r1785)')
@controller.sphinx_version.should == '0.9.9'
end

it "should return 0.9.9 if using 0.9.9 rc1" do
@controller.stub!(:` => 'Sphinx 0.9.9-rc1 (r1566)')
@controller.stub(:` => 'Sphinx 0.9.9-rc1 (r1566)')
@controller.sphinx_version.should == '0.9.9'
end

it "should return 0.9.8 if using 0.9.8.1" do
@controller.stub!(:` => 'Sphinx 0.9.8.1-release (r1533)')
@controller.stub(:` => 'Sphinx 0.9.8.1-release (r1533)')
@controller.sphinx_version.should == '0.9.8'
end

it "should return 0.9.8 if using 0.9.8" do
@controller.stub!(:` => 'Sphinx 0.9.8-release (r1371)')
@controller.stub(:` => 'Sphinx 0.9.8-release (r1371)')
@controller.sphinx_version.should == '0.9.8'
end
end
Expand Down

0 comments on commit a9096ea

Please sign in to comment.