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

https://bitbucket.org/mediashelf/fedora-migrator · Ruby · 25 lines · 19 code · 6 blank · 0 comment · 0 complexity · 8cbc374ba871015db00b2a6079754331 MD5 · raw file

  1. require 'facets/string/modulize'
  2. require 'test/unit'
  3. class TC_String_Modulize < Test::Unit::TestCase
  4. def test_modulize_snakecase
  5. a = "foo_bar"
  6. r = "FooBar"
  7. assert_equal(r, a.modulize)
  8. end
  9. def test_modulize_pathname
  10. a = "foo/bar"
  11. r = "Foo::Bar"
  12. assert_equal(r, a.modulize)
  13. end
  14. def test_modulize_on_methodized_string
  15. a = "foo__bar"
  16. r = "Foo::Bar"
  17. assert_equal(r, a.modulize)
  18. end
  19. end