Sha256: 7b5e170ff128c531913cf02043059fbd59badb0f485355f8e8a58c4e3b5f5527

Contents?: true

Size: 945 Bytes

Versions: 1

Compression:

Stored size: 945 Bytes

Contents

require 'spec_helper'
require 'sewell'

describe Sewell do
=begin
  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
=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.2 spec/sewell/sewell_spec.rb