Sha256: 89c199849208dda55f7bc2528be90fe2f2b9c56df55fff99ebbfe6fc69588add

Contents?: true

Size: 920 Bytes

Versions: 28

Compression:

Stored size: 920 Bytes

Contents

require 'spec_helper'

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

  values = [{ :string => 'removes empty fields',
              :start => '',
              :end => nil
            },
            { :string => 'removes whitespace only fields',
              :start => '   ',
              :end => nil
            },
            { :string => 'removes whitespace only fields with newlines',
              :start => "\n\t  \t\n",
              :end => nil
            },

            { :string => 'keeps whitespace heavy fields with newlines',
              :start => "\n\t value \t\n",
              :end => "\n\t value \t\n"
            },
            { :string => 'leaves non-empty fields unaltered',
              :start => 'moomin',
              :end => 'moomin'
            }]

  it_behaves_like 'a string enrichment', values
  include_examples 'skips non-strings'
end

Version data entries

28 entries across 28 versions & 1 rubygems

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