Sha256: 2e1b8fb4304c9f932ea3fb8962cd29e05c17cfeb38a3dcc23fc7300855db1088

Contents?: true

Size: 922 Bytes

Versions: 17

Compression:

Stored size: 922 Bytes

Contents

require 'spec_helper'

describe Krikri::Enrichments::StripEndingPunctuation do
  it_behaves_like 'a field enrichment'

  values = [{ :string => 'removes punctuation from end of field',
              :start => "moomin!...!;,.",
              :end => "moomin"
            },
            { :string => 'keeps initials',
              :start => "Smith, Smithy Q.",
              :end => "Smith, Smithy Q."
            },
            { :string => 'keeps closing parentheses',
              :start => "(Smith)",
              :end => "(Smith)"
            },
            { :string => 'keeps two letter abbreviations',
              :start => "66 cm.",
              :end => "66 cm."
            },
            { :string => 'leaves other fields unaltered',
              :start => "moominpapa;:;:; moominmama",
              :end => "moominpapa;:;:; moominmama"
            }]

  it_behaves_like 'a string enrichment', values
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
krikri-0.7.6 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.7.5 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.7.4 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.7.3 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.7.2 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.7.1 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.7.0 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.6.0 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.5.7 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.5.6 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.5.5 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.5.4 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.5.3 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.5.2 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.5.1 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.5.0 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.4.0 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb