示例#1
0
			result, _ := localContext.GetInt("int")
			Ω(result).Should(Equal(123))
		})

		It("can store bool value as provided", func() {
			localContext.PutBool("key", true)

			result, _ := localContext.GetBool("key")
			Ω(result).Should(Equal(true))
		})

		It("can store float64 value as provided", func() {
			localContext.PutFloat64("key", float64(3.14))

			result, _ := localContext.GetFloat64("key")
			Ω(result).Should(Equal(float64(3.14)))
		})
	})

	Context("Cloning map", func() {
		It("returns a copy of the cloned context map", func() {
			localContext.PutString("str1", "abc")
			localContext.PutString("str2", "def")

			cloned := localContext.Clone()

			localContext.PutString("str1", "123")

			result, _ := localContext.GetString("str1")
			Ω(result).Should(Equal("123"))