Sha256: 74f8365c637e3d839b6fadb8f106a3b99b38dbb00c93a866404dc2ae3ed6d746

Contents?: true

Size: 1.03 KB

Versions: 9

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

describe Solrizer::Extractor do
  
  before(:all) do
    @extractor = Solrizer::Extractor.new
  end
  
  describe ".format_node_value" do
    it "should strip white space out of the array and join it with a single blank" do
      Solrizer::Extractor.format_node_value([" test    \n   node    \t value \t"]).should == "test node value"
      Solrizer::Extractor.format_node_value([" test ", "     \n   node ", "   \t value \t"]).should == "test node value"
    end
    it "should return an empty string if given an argument of nil" do
      Solrizer::Extractor.format_node_value(nil).should == ""
    end

    it "should strip white space out of a string" do
      Solrizer::Extractor.format_node_value("raw  string\n with whitespace").should == "raw string with whitespace"
    end
  end

  describe "#insert_solr_field_value" do
    it "should initialize a solr doc list if it is nil" do
       solr_doc = {'title_t' => nil }
       Solrizer::Extractor.insert_solr_field_value(solr_doc, 'title_t', 'Frank')
    end
  end
  
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
solrizer-2.2.0 spec/units/extractor_spec.rb
solrizer-2.1.0 spec/units/extractor_spec.rb
solrizer-2.1.0.rc1 spec/units/extractor_spec.rb
solrizer-2.0.0 spec/units/extractor_spec.rb
solrizer-2.0.0.rc7 spec/units/extractor_spec.rb
solrizer-2.0.0.rc6 spec/units/extractor_spec.rb
solrizer-2.0.0.rc5 spec/units/extractor_spec.rb
solrizer-2.0.0.rc4 spec/units/extractor_spec.rb
solrizer-2.0.0.rc3 spec/units/extractor_spec.rb