Sha256: 8412bfa1174590c39d450be38d7415175c1aa8cc57b34b3ef894552c87197fd4

Contents?: true

Size: 1.04 KB

Versions: 12

Compression:

Stored size: 1.04 KB

Contents

# encoding: utf-8
require 'spec_helper'

describe Solr::SchemaGenerator do

  before(:each) do
    @types = stub :types
    @configuration = stub :configuration, :types => @types
    @generator = Solr::SchemaGenerator.new @configuration
  end

  describe 'bound_field_names' do
    before(:each) do
      @generator.stub! :combine_field_names => :some_field_names
    end
    it 'should bind field_names' do
      b = @generator.bound_field_names

      eval('field_names', b).should == :some_field_names
    end
  end

  describe 'generate' do
    before(:each) do
      @generator.stub! :bound_field_names
      @generator.stub! :generate_schema_for
    end
    it 'should receive generate_schema_for once with the result of extract_binding' do
      @generator.stub! :bound_field_names => :some_binding

      @generator.should_receive(:generate_schema_for).once.with :some_binding

      @generator.generate
    end
    it 'should extract the binding' do
      @generator.should_receive(:bound_field_names).once.with

      @generator.generate
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
picky-0.2.2 spec/lib/solr/schema_generator_spec.rb
picky-0.2.1 spec/lib/solr/schema_generator_spec.rb
picky-0.2.0 spec/lib/solr/schema_generator_spec.rb
picky-0.1.0 spec/lib/solr/schema_generator_spec.rb
picky-0.0.9 spec/lib/solr/schema_generator_spec.rb
picky-0.0.8 spec/lib/solr/schema_generator_spec.rb
picky-0.0.7 spec/lib/solr/schema_generator_spec.rb
picky-0.0.6 spec/lib/solr/schema_generator_spec.rb
picky-0.0.5 spec/lib/solr/schema_generator_spec.rb
picky-0.0.4 spec/lib/solr/schema_generator_spec.rb
picky-0.0.3 spec/lib/solr/schema_generator_spec.rb
picky-0.0.2 spec/lib/solr/schema_generator_spec.rb