spec/lib/tokenizers/base_spec.rb in picky-0.11.2 vs spec/lib/tokenizers/base_spec.rb in picky-0.12.0

- old
+ new

@@ -11,11 +11,11 @@ describe "substitute(s)_characters*" do it "doesn't substitute if there is no substituter" do @tokenizer.substitute_characters('abcdefghijklmnopqrstuvwxyzäöü').should == 'abcdefghijklmnopqrstuvwxyzäöü' end it "uses the substituter to replace characters" do - @tokenizer.substitutes_characters_with CharacterSubstitution::European.new + @tokenizer.substitutes_characters_with CharacterSubstituters::WestEuropean.new @tokenizer.substitute_characters('abcdefghijklmnopqrstuvwxyzäöü').should == 'abcdefghijklmnopqrstuvwxyzaeoeue' end it "uses the european substituter as default" do @tokenizer.substitutes_characters_with @@ -115,32 +115,9 @@ it "has remove_illegals" do lambda { @tokenizer.remove_illegals('abcdefghijklmnop') }.should_not raise_error end it "removes illegal characters" do @tokenizer.remove_illegals('abcdefghijklmnop').should == 'bcdeghijklmnp' - end - end - end - - describe 'contracts_expressions' do - context 'without contract_expressions called' do - it 'should define a method contract' do - lambda { @tokenizer.contract('from this text') }.should_not raise_error - end - it 'should define a method contract that does nothing' do - unchanging = stub :unchanging - @tokenizer.contract unchanging - end - end - context 'with contracts_expressions called' do - before(:each) do - @tokenizer.contracts_expressions(/Mister|Mr./, 'mr') - end - it 'should define a method remove_stopwords' do - lambda { @tokenizer.contract('from this text') }.should_not raise_error - end - it 'should define a method contract that contracts expressions' do - @tokenizer.contract('Mister Meyer, Mr. Peter').should == 'mr Meyer, mr Peter' end end end describe 'stopwords' do \ No newline at end of file