Sha256: 954cca211a7d18dd92c3594905d16ff68009f636058fd6a006591f3bf2e77998

Contents?: true

Size: 553 Bytes

Versions: 10

Compression:

Stored size: 553 Bytes

Contents

require 'spec_helper'

describe Dusen::Parser do

  describe '.parse' do

    it 'should parse field tokens first, because they usually give maximum filtering at little cost' do
      query = Dusen::Parser.parse('word1 field1:field1-value word2 field2:field2-value')
      query.collect(&:value).should == ['field1-value', 'field2-value', 'word1', 'word2']
    end

    it 'should not consider the dash to be a word boundary' do
      query = Dusen::Parser.parse('Baden-Baden')
      query.collect(&:value).should == ['Baden-Baden']
    end

  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
dusen-0.5.2 spec/shared/spec/dusen/parser_spec.rb
dusen-0.5.1 spec/shared/spec/dusen/parser_spec.rb
dusen-0.5 spec/shared/spec/dusen/parser_spec.rb
dusen-0.4.11 spec/shared/spec/dusen/parser_spec.rb
dusen-0.4.10 spec/shared/spec/dusen/parser_spec.rb
dusen-0.4.9 spec/shared/spec/dusen/parser_spec.rb
dusen-0.4.8 spec/shared/spec/dusen/parser_spec.rb
dusen-0.4.6 spec/shared/spec/dusen/parser_spec.rb
dusen-0.4.5 spec/shared/spec/dusen/parser_spec.rb
dusen-0.4.4 spec/shared/spec/dusen/parser_spec.rb