tests/testthat/test-str_title_case.r

library(testthat)
library(lettercase)
library(magrittr)

context( 'str_title_case')

str_title_case( 'mission of burma' ) %>% expect_equal( 'Mission Of Burma' ) 
str_title_case( 'mission_of_burma' ) %>% expect_equal( 'Mission Of Burma' )
str_title_case( 'Mission of Burma' ) %>% expect_equal( 'Mission Of Burma' )

# str_title_case( 'mission-of-burma' ) %>% expect_equal( 'Mission Of Burma' )
# str_title_case( 'MISSION OF BURMA' ) %>% expect_equal( 'Mission Of Burma' )
# str_title_case( 'MissionOfBurma' )   %>% expect_equal( 'Mission Of Burma' )

Try the lettercase package in your browser

Any scripts or data that you put into this service are public.

lettercase documentation built on May 29, 2017, 12:28 p.m.