@@ -12,16 +12,43 @@ import Control.Applicative
1212#endif
1313
1414spec :: Spec
15−spec = describe "humazine" $ do
16− it "converts snake case to a human-readable string" $ do
17− employee <- SomeWord <$> mkWord "employee"
18− salary <- SomeWord <$> mkWord "salary"
19− humanize [employee,salary] `shouldBe` "Employee salary"
20− it "turns underscores into spaces" $ do
21− employee <- SomeWord <$> mkWord "employee"
22− has <- SomeWord <$> mkWord "has"
23− salary <- SomeWord <$> mkWord "salary"
24− humanize [employee, has, salary] `shouldBe` "Employee has salary"
25− it "capitalizes the first word of a sentence" $ do
26− underground <- SomeWord <$> mkWord "underground"
27− humanize [underground] `shouldBe` "Underground"
15+spec = do
16+ describe "humanize" $ do
17+ it "converts snake case to a human-readable string" $ do
18+ employee <- SomeWord <$> mkWord "employee"
19+ salary <- SomeWord <$> mkWord "salary"
20+ humanize [employee,salary] `shouldBe` "Employee salary"
21+ it "turns underscores into spaces" $ do
22+ employee <- SomeWord <$> mkWord "employee"
23+ has <- SomeWord <$> mkWord "has"
24+ salary <- SomeWord <$> mkWord "salary"
25+ humanize [employee, has, salary] `shouldBe` "Employee has salary"
26+ it "capitalizes the first word of a sentence" $ do
27+ underground <- SomeWord <$> mkWord "underground"
28+ humanize [underground] `shouldBe` "Underground"
29+ describe "humanizeCustom False" $ do
30+ it "converts snake case to a human-readable string" $ do
31+ employee <- SomeWord <$> mkWord "employee"
32+ salary <- SomeWord <$> mkWord "salary"
33+ humanizeCustom False [employee,salary] `shouldBe` "employee salary"
34+ it "turns underscores into spaces" $ do
35+ employee <- SomeWord <$> mkWord "employee"
36+ has <- SomeWord <$> mkWord "has"
37+ salary <- SomeWord <$> mkWord "salary"
38+ humanizeCustom False [employee, has, salary] `shouldBe` "employee has salary"
39+ it "lower-cases the first word of a sentence" $ do
40+ underground <- SomeWord <$> mkWord "underground"
41+ humanizeCustom False [underground] `shouldBe` "underground"
42+ describe "humanizeCustom True" $ do
43+ it "converts snake case to a human-readable string" $ do
44+ employee <- SomeWord <$> mkWord "employee"
45+ salary <- SomeWord <$> mkWord "salary"
46+ humanizeCustom True [employee,salary] `shouldBe` "Employee salary"
47+ it "turns underscores into spaces" $ do
48+ employee <- SomeWord <$> mkWord "employee"
49+ has <- SomeWord <$> mkWord "has"
50+ salary <- SomeWord <$> mkWord "salary"
51+ humanizeCustom True [employee, has, salary] `shouldBe` "Employee has salary"
52+ it "capitalizes the first word of a sentence" $ do
53+ underground <- SomeWord <$> mkWord "underground"
54+ humanizeCustom True [underground] `shouldBe` "Underground"