require File.dirname(__FILE__) + '/../../spec_helper'
require File.dirname(__FILE__) + '/../../../lib/cucumber/mate/table_aligner'

module Cucumber
  module Mate
    describe TableAligner do
      it "should align a simple table" do
        unaligned = "   |    a |b|\n|c|  d   |"
        TableAligner.new.align(unaligned).should == "   | a | b |\n   | c | d |"
      end
    end
  end
end
require File.dirname(__FILE__) + '/../../spec_helper'
require File.dirname(__FILE__) + '/../../../lib/cucumber/mate/table_aligner'

module Cucumber
  module Mate
    describe TableAligner do
      it "should align a simple table" do
        unaligned = "   |    a |b|\n|c|  d   |"
        TableAligner.new.align(unaligned).should == "   | a | b |\n   | c | d |"
      end
      
      it "should align a table with multi-byte UTF8 values" do
        unaligned = "   | a |b|\n" +
                    "   |÷|  d  |"
        TableAligner.new.align(unaligned).should == "   | a | b |\n" +
                                                    "   | ÷ | d |"
      end
    end
  end
end
Add spec for multibyte UTF8 table alignment
Add spec for multibyte UTF8 table alignment

Signed-off-by: Ben Mabey <73675debcd8a436be48ec22211dcf44fe0df0a64@benmabey.com>