initial commit
[govpp.git] / vendor / github.com / onsi / gomega / gstruct / pointer_test.go
1 package gstruct_test
2
3 import (
4         . "github.com/onsi/ginkgo"
5         . "github.com/onsi/gomega"
6         . "github.com/onsi/gomega/gstruct"
7 )
8
9 var _ = Describe("PointTo", func() {
10         It("should fail when passed nil", func() {
11                 var p *struct{}
12                 Ω(p).Should(BeNil())
13         })
14
15         It("should succeed when passed non-nil pointer", func() {
16                 var s struct{}
17                 Ω(&s).Should(PointTo(Ignore()))
18         })
19
20         It("should unwrap the pointee value", func() {
21                 i := 1
22                 Ω(&i).Should(PointTo(Equal(1)))
23                 Ω(&i).ShouldNot(PointTo(Equal(2)))
24         })
25
26         It("should work with nested pointers", func() {
27                 i := 1
28                 ip := &i
29                 ipp := &ip
30                 Ω(ipp).Should(PointTo(PointTo(Equal(1))))
31                 Ω(ipp).ShouldNot(PointTo(PointTo(Equal(2))))
32         })
33 })