Sha256: 48e091f2cd25c56308b05ee260721b43cfa2ec736be2505c12b87e130ac85ca5

Contents?: true

Size: 620 Bytes

Versions: 18

Compression:

Stored size: 620 Bytes

Contents

require 'spec_helper'

describe Dusen::Query do

  describe '#condensed' do

    it 'should return a version of the query where all text tokens have been collapsed into a single token with an Array value' do
      query = Dusen::Parser.parse('field:value foo bar baz')
      query.tokens.size.should == 4
      condensed_query = query.condensed
      condensed_query.tokens.size.should == 2
      condensed_query[0].field.should == 'field'
      condensed_query[0].value.should == 'value'
      condensed_query[1].field.should == 'text'
      condensed_query[1].value.should == ['foo', 'bar', 'baz']
    end

  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
dusen-0.6.1 spec/shared/spec/dusen/query_spec.rb
dusen-0.6.0 spec/shared/spec/dusen/query_spec.rb
dusen-0.5.3 spec/shared/spec/dusen/query_spec.rb
dusen-0.5.2 spec/shared/spec/dusen/query_spec.rb
dusen-0.5.1 spec/shared/spec/dusen/query_spec.rb
dusen-0.5 spec/shared/spec/dusen/query_spec.rb
dusen-0.4.11 spec/shared/spec/dusen/query_spec.rb
dusen-0.4.10 spec/shared/spec/dusen/query_spec.rb
dusen-0.4.9 spec/shared/spec/dusen/query_spec.rb
dusen-0.4.8 spec/shared/spec/dusen/query_spec.rb
dusen-0.4.6 spec/shared/spec/dusen/query_spec.rb
dusen-0.4.5 spec/shared/spec/dusen/query_spec.rb
dusen-0.4.4 spec/shared/spec/dusen/query_spec.rb
dusen-0.4.3 spec/shared/spec/dusen/query_spec.rb
dusen-0.4.2 spec/shared/spec/dusen/query_spec.rb
dusen-0.4.1 spec/shared/spec/dusen/query_spec.rb
dusen-0.4.0 spec/shared/spec/dusen/query_spec.rb
dusen-0.3.0 spec/shared/spec/dusen/query_spec.rb