/vendor/gems/facets-2.4.5/test/core/string/test_align.rb

https://bitbucket.org/mediashelf/fedora-migrator · Ruby · 22 lines · 13 code · 8 blank · 1 comment · 0 complexity · ba51eb2f5599cd02bad5f8838286d522 MD5 · raw file

  1. # Test for lib/facets/string/align.rb
  2. require 'facets/string/align.rb'
  3. require 'test/unit'
  4. class TestStringAlign < Test::Unit::TestCase
  5. def test_align_right
  6. assert_equal( " xxx", "xxx".align_right(9) )
  7. end
  8. def test_align_left
  9. assert_equal( "xxx ", "xxx".align_left(9) )
  10. end
  11. def test_align_center
  12. assert_equal( " xxx ", "xxx".align_center(9) )
  13. end
  14. end