Sha256: ee3262459452f938c482c370e8bf1a6d2d5c1221f386d6b7a051b9d5091896b7

Contents?: true

Size: 715 Bytes

Versions: 1

Compression:

Stored size: 715 Bytes

Contents

require 'spec_helper'

module AsciiDataTools
  module RecordType
    module Normaliser
      describe Normaliser do
        include RecordTypeHelpers
        before do
          @fields = fields do
             field "field1", :length => 3
             field "field2", :length => 5, :normalised => true
             field "field3", :length => 3, :normalised => true
             field "field4", :length => 1
           end
           @type = Struct.new(:fields).new(@fields)
           @type.extend(Normaliser)
        end

        it "should X out the characters in fields configured for normalisation" do
          @type.normalise("123ABCDEXYZ\n").should == "123XXXXXXXX\n"
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ascii-data-tools-0.9 spec/ascii-data-tools/record_type/normaliser_spec.rb