Sha256: 493944c562e5bbcbe0ba1f81b502cc4acf1388f4ec6b3c95e3d91f9f5e9fdf1f

Contents?: true

Size: 594 Bytes

Versions: 2

Compression:

Stored size: 594 Bytes

Contents

require 'spec_helper'

describe ACH::Formatter do
  before(:all) do
    module ACH::Formatter
      # redefining RULES FOR new test values
      RULES = remove_const(:RULES).dup
      RULES[:ljust_5] = '<-5'
      RULES[:ljust_5_transform] = '<-5|upcase'
      RULES[:rjust_6] = '->6'
      RULES[:rjust_6_spaced] = '->6-'
    end
  end
  
  it{ ACH::Formatter.ljust_5('foo').should == 'foo  ' }
  
  it{ ACH::Formatter.ljust_5_transform('bar').should == 'BAR  ' }
  
  it{ ACH::Formatter.rjust_6(1599).should == '001599' }
  
  it{ ACH::Formatter.rjust_6_spaced(1599).should == '  1599' }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ach_builder-0.2.2 spec/formatter_spec.rb
ach_builder-0.2.1 spec/formatter_spec.rb