Sha256: d0c74fc722015e88d70ca4cf48ed6024b3e86508adbea37f2cbe1a68ed0a957f

Contents?: true

Size: 1.07 KB

Versions: 55

Compression:

Stored size: 1.07 KB

Contents

require 'spec_helper'

describe ThinkingSphinx::Index::FauxColumn do  
  describe "coerce class method" do
    before :each do
      @column = stub('column')
      ThinkingSphinx::Index::FauxColumn.stub!(: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
  
  describe '#to_ary' do
    it "should return an array with the instance inside it" do
      subject.to_ary.should == [subject]
    end
  end
end

Version data entries

55 entries across 55 versions & 6 rubygems

Version Path
friendlyfashion-thinking-sphinx-2.0.14.4 spec/thinking_sphinx/index/faux_column_spec.rb
friendlyfashion-thinking-sphinx-2.0.14.3 spec/thinking_sphinx/index/faux_column_spec.rb
thinking-sphinx-2.1.0 spec/thinking_sphinx/index/faux_column_spec.rb
thinking-sphinx-1.5.0 spec/thinking_sphinx/index/faux_column_spec.rb
friendlyfashion-thinking-sphinx-2.0.14.2 spec/thinking_sphinx/index/faux_column_spec.rb
friendlyfashion-thinking-sphinx-2.0.14.1 spec/thinking_sphinx/index/faux_column_spec.rb
thinking-sphinx-2.0.14 spec/thinking_sphinx/index/faux_column_spec.rb
thinking-sphinx-1.4.14 spec/thinking_sphinx/index/faux_column_spec.rb
friendlyfashion-thinking-sphinx-2.0.13.3 spec/thinking_sphinx/index/faux_column_spec.rb
friendlyfashion-thinking-sphinx-2.0.13.2 spec/thinking_sphinx/index/faux_column_spec.rb
friendlyfashion-thinking-sphinx-2.0.13.1 spec/thinking_sphinx/index/faux_column_spec.rb
friendlyfashion-thinking-sphinx-2.0.13 spec/thinking_sphinx/index/faux_column_spec.rb
thinking-sphinx-2.0.13 spec/thinking_sphinx/index/faux_column_spec.rb
thinking-sphinx-1.4.13 spec/thinking_sphinx/index/faux_column_spec.rb
thinking-sphinx-2.0.12 spec/thinking_sphinx/index/faux_column_spec.rb
thinking-sphinx-1.4.12 spec/thinking_sphinx/index/faux_column_spec.rb
thinking-sphinx-2.0.11 spec/thinking_sphinx/index/faux_column_spec.rb
thinking-sphinx-1.4.11 spec/thinking_sphinx/index/faux_column_spec.rb
thinking-sphinx-2.0.10 spec/thinking_sphinx/index/faux_column_spec.rb
thinking-sphinx-1.4.10 spec/thinking_sphinx/index/faux_column_spec.rb