Sha256: 49aae542806af3b7b6c68f7c7aa87feb33a9cbdf874cbb7f3322a970480868ff

Contents?: true

Size: 1.09 KB

Versions: 11

Compression:

Stored size: 1.09 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 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

11 entries across 11 versions & 4 rubygems

Version Path
angelf-thinking-sphinx-1.3.18 spec/thinking_sphinx/auto_version_spec.rb
thinking-sphinx-2.0.0.rc2 spec/thinking_sphinx/auto_version_spec.rb
thinking-sphinx-1.3.19 spec/thinking_sphinx/auto_version_spec.rb
thorsson_thinking-sphinx-1.3.18 spec/thinking_sphinx/auto_version_spec.rb
thinking-sphinx-allen-1.3.18.4 spec/thinking_sphinx/auto_version_spec.rb
thinking-sphinx-allen-1.3.18.3 spec/thinking_sphinx/auto_version_spec.rb
thinking-sphinx-allen-1.3.18.2 spec/thinking_sphinx/auto_version_spec.rb
thinking-sphinx-2.0.0.rc1 spec/thinking_sphinx/auto_version_spec.rb
thinking-sphinx-allen-1.3.18.1 spec/thinking_sphinx/auto_version_spec.rb
thinking-sphinx-allen-1.3.18 spec/thinking_sphinx/auto_version_spec.rb
thinking-sphinx-1.3.18 spec/thinking_sphinx/auto_version_spec.rb