Sha256: 76e360c33cf7930538489b5b120f0ffc731eb86686227192006d1d909140bf4e

Contents?: true

Size: 991 Bytes

Versions: 63

Compression:

Stored size: 991 Bytes

Contents

require 'spec/spec_helper'

describe ThinkingSphinx::Index::FauxColumn do  
  describe "coerce class method" do
    before :each do
      @column = ThinkingSphinx::Index::FauxColumn.stub_instance
      ThinkingSphinx::Index::FauxColumn.stub_method(:new => @column)
    end
    
    it "should return a single faux column if passed a string" do
      ThinkingSphinx::Index::FauxColumn.coerce("string").should == @column
    end
    
    it "should return a single faux column if passed a symbol" do
      ThinkingSphinx::Index::FauxColumn.coerce(:string).should == @column
    end
    
    it "should return an array of faux columns if passed an array of strings" do
      ThinkingSphinx::Index::FauxColumn.coerce(["one", "two"]).should == [
        @column, @column
      ]
    end
    
    it "should return an array of faux columns if passed an array of symbols" do
      ThinkingSphinx::Index::FauxColumn.coerce([:one, :two]).should == [
        @column, @column
      ]
    end
  end
end

Version data entries

63 entries across 63 versions & 11 rubygems

Version Path
freelancing-god-thinking-sphinx-1.2.10 spec/lib/thinking_sphinx/index/faux_column_spec.rb
freelancing-god-thinking-sphinx-1.2.11 spec/lib/thinking_sphinx/index/faux_column_spec.rb
freelancing-god-thinking-sphinx-1.2.2 spec/lib/thinking_sphinx/index/faux_column_spec.rb
freelancing-god-thinking-sphinx-1.2.3 spec/lib/thinking_sphinx/index/faux_column_spec.rb
freelancing-god-thinking-sphinx-1.2.4 spec/lib/thinking_sphinx/index/faux_column_spec.rb
freelancing-god-thinking-sphinx-1.2.5 spec/lib/thinking_sphinx/index/faux_column_spec.rb
freelancing-god-thinking-sphinx-1.2.6 spec/lib/thinking_sphinx/index/faux_column_spec.rb
freelancing-god-thinking-sphinx-1.2.7 spec/lib/thinking_sphinx/index/faux_column_spec.rb
freelancing-god-thinking-sphinx-1.2.8 spec/lib/thinking_sphinx/index/faux_column_spec.rb
freelancing-god-thinking-sphinx-1.2.9 spec/lib/thinking_sphinx/index/faux_column_spec.rb
hariton-thinking-sphinx-1.2.11.2 spec/lib/thinking_sphinx/index/faux_column_spec.rb
hariton-thinking-sphinx-1.2.11 spec/lib/thinking_sphinx/index/faux_column_spec.rb
hariton-thinking-sphinx-1.2.7.0 spec/lib/thinking_sphinx/index/faux_column_spec.rb
hariton-thinking-sphinx-1.2.7.1 spec/lib/thinking_sphinx/index/faux_column_spec.rb
initforthe-thinking-sphinx-1.1.21 spec/unit/thinking_sphinx/index/faux_column_spec.rb
lostboy-thinking-sphinx-1.1.5.1 spec/unit/thinking_sphinx/index/faux_column_spec.rb
lostboy-thinking-sphinx-1.1.5.2 spec/unit/thinking_sphinx/index/faux_column_spec.rb
lostboy-thinking-sphinx-1.1.5.3 spec/unit/thinking_sphinx/index/faux_column_spec.rb
lostboy-thinking-sphinx-1.1.5.4 spec/unit/thinking_sphinx/index/faux_column_spec.rb
lostboy-thinking-sphinx-1.1.5.5 spec/unit/thinking_sphinx/index/faux_column_spec.rb