Sha256: 740c77ad526bee7c6806e9a09952f28aa99c6b24ab30c41de9afe5fe84c5f18e

Contents?: true

Size: 1.25 KB

Versions: 28

Compression:

Stored size: 1.25 KB

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 => 'removes period from longer words',
              :start => "Regents Examinations.",
              :end => "Regents Examinations"
            },
            { :string => 'removes period from longer words with parens',
              :start => "Budget - New York (State).",
              :end => "Budget - New York (State)"
            },
            { :string => 'leaves other fields unaltered',
              :start => "moominpapa;:;:; moominmama",
              :end => "moominpapa;:;:; moominmama"
            }]

  it_behaves_like 'a string enrichment', values
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
krikri-0.15.2 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.15.1 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.15.0 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.14.0 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.13.2 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.13.1 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.13.0 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.12.4 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.12.3 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.12.1 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.12.0 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.12.0.pre.rc.1 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.11.2 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.11.1 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.11.0 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.10.1 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.10.0 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.9.0 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.8.9 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb
krikri-0.8.8 spec/lib/krikri/enrichments/strip_ending_punctuation_spec.rb