spec/lib/internals/tokenizers/base_spec.rb in picky-2.0.0 vs spec/lib/internals/tokenizers/base_spec.rb in picky-2.1.0
- old
+ new
@@ -3,44 +3,46 @@
require 'spec_helper'
describe Internals::Tokenizers::Base do
context 'with special instance' do
- let (:tokenizer) { described_class.new reject_token_if: lambda { |token| token.to_s.length < 2 || token == :hello } }
+ let (:tokenizer) { described_class.new reject_token_if: lambda { |token| token.to_s.length < 2 || token == :hello }, case_sensitive: true }
it 'rejects tokens with length < 2' do
tokenizer.reject([:'', :a, :ab, :abc]).should == [:ab, :abc]
end
it 'rejects tokens that are called :hello' do
tokenizer.reject([:hel, :hell, :hello]).should == [:hel, :hell]
end
describe 'to_s' do
- it 'does something' do
+ it 'spits out the right text' do
tokenizer.to_s.should == <<-EXPECTED
Removes characters: -
Stopwords: -
Splits text on: /\\s/
Removes chars after split: -
Normalizes words: -
Rejects tokens? Yes, see line 8 in app/application.rb
Substitutes chars? -
+Case sensitive? Yes.
EXPECTED
end
end
end
context 'with normal instance' do
let(:tokenizer) { described_class.new }
describe 'to_s' do
- it 'does something' do
+ it 'spits out the right text' do
tokenizer.to_s.should == <<-EXPECTED
Removes characters: -
Stopwords: -
Splits text on: /\\s/
Removes chars after split: -
Normalizes words: -
Rejects tokens? -
Substitutes chars? -
+Case sensitive? -
EXPECTED
end
end
describe 'reject_token_if' do
\ No newline at end of file