Sha256: 6b7be353acb48c5334fcde3196383ffc7a17757445d55f58a9918999f0c8b740

Contents?: true

Size: 1.34 KB

Versions: 5

Compression:

Stored size: 1.34 KB

Contents

require 'spec_helper'

describe ThinkingSphinx::AutoVersion do
  describe '.detect' do
    before :each do
      @config = ThinkingSphinx::Configuration.instance
    end
    
    it "should require 0.9.8 if that is the detected version" do
      ThinkingSphinx::AutoVersion.should_receive(:require).
        with('riddle/0.9.8')
      
      @config.stub!(:version => '0.9.8')
      ThinkingSphinx::AutoVersion.detect
    end
    
    it "should require 0.9.9 if that is the detected version" do
      ThinkingSphinx::AutoVersion.should_receive(:require).
        with('riddle/0.9.9')
      
      @config.stub!(:version => '0.9.9')
      ThinkingSphinx::AutoVersion.detect
    end
    
    it "should require 1.10-beta if that is the detected version" do
      ThinkingSphinx::AutoVersion.should_receive(:require).
        with('riddle/1.10')
      
      @config.stub!(:version => '1.10-beta')
      ThinkingSphinx::AutoVersion.detect
    end
    
    it "should output a warning if the detected version is something else" do
      STDERR.should_receive(:puts)
      
      @config.stub!(:version => '0.9.7')
      ThinkingSphinx::AutoVersion.detect
    end
    
    it "should output a warning if the version cannot be determined" do
      STDERR.should_receive(:puts)
      
      @config.stub!(:version => nil)
      ThinkingSphinx::AutoVersion.detect
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
thinking-sphinx-2.0.1 spec/thinking_sphinx/auto_version_spec.rb
thinking-sphinx-2.0.0 spec/thinking_sphinx/auto_version_spec.rb
thinking-sphinx-1.4.0 spec/thinking_sphinx/auto_version_spec.rb
thorsson_thinking-sphinx-2.0 spec/thinking_sphinx/auto_version_spec.rb
thinking-sphinx-1.3.20 spec/thinking_sphinx/auto_version_spec.rb