Sha256: cf385867eac331e13aabbf8bac4025177640f56fc424d2101b06a5adabdc405e
Contents?: true
Size: 919 Bytes
Versions: 1
Compression:
Stored size: 919 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:@Single )" end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sewell-1.0.4 | spec/sewell/sewell_spec.rb |