Sha256: 2de1d8e356c58c8289bf8d3f1195cc9254f708ef2e4dca9d652323b89b137808
Contents?: true
Size: 933 Bytes
Versions: 1
Compression:
Stored size: 933 Bytes
Contents
require 'spec_helper' require 'sewell' describe Sewell do it 'raise TypeError unless input String' do lambda{Sewell.generate [], []}.should raise_error(TypeError) end it 'can generate from string' do Sewell.generate('sena:airi OR mashiro AND nuko:buta', %w{sena uryu nuko}).should == '( sena:@airi ) OR ( sena:@mashiro OR uryu:@mashiro OR nuko:@mashiro ) + ( nuko:@buta )' Sewell.generate('-inui airi', ['mashiro']).should == '( mashiro:@airi ) - ( mashiro:@inui )' end it 'can generate from hash' do Sewell.generate({sena: 'airi OR huro', nuko: 'trape'}, 'AND').should == '( sena:@airi OR sena:@huro ) + ( nuko:@trape )' Sewell.generate({mashiro: '-inui airi'}, 'AND').should == '( mashiro:@airi - mashiro:@inui )' end it 'can generate with "-"' do Sewell.generate('ビジュメニア - Single', ['buta']).should == "( buta:@ビジュメニア ) + ( buta:@- ) + ( buta:@Single )" end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sewell-1.0.3 | spec/sewell/sewell_spec.rb |