File: helpers_test.go

package info (click to toggle)
golang-github-manyminds-api2go 1.0-RC2%2Bgit20161229.31.dc368bb-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 484 kB
  • ctags: 488
  • sloc: sh: 23; makefile: 3
file content (26 lines) | stat: -rw-r--r-- 567 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package jsonapi

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("StringHelpers", func() {
	Context("json funcs", func() {
		It("Pluralizes", func() {
			Expect(Pluralize("post")).To(Equal("posts"))
			Expect(Pluralize("posts")).To(Equal("posts"))
			Expect(Pluralize("category")).To(Equal("categories"))
		})

		Context("Jsonify", func() {
			It("handles empty strings", func() {
				Expect(Jsonify("")).To(Equal(""))
			})

			It("uses common initialisms", func() {
				Expect(Jsonify("RAM")).To(Equal("ram"))
			})
		})
	})
})