@@ -23,11 +23,11 @@ var _ = Describe("Info Actions", func() {
2323 })
2424
2525 Describe ("GetRootResponse" , func () {
26- When ("getting info is successful" , func () {
26+ When ("getting root is successful" , func () {
2727 BeforeEach (func () {
28- fakeCloudControllerClient .GetInfoReturns (
29- ccv3.Info {
30- Links : ccv3.InfoLinks {
28+ fakeCloudControllerClient .GetRootReturns (
29+ ccv3.Root {
30+ Links : ccv3.RootLinks {
3131 LogCache : resources.APILink {HREF : "some-log-cache-url" },
3232 },
3333 },
@@ -42,11 +42,58 @@ var _ = Describe("Info Actions", func() {
4242
4343 Expect (warnings ).To (ConsistOf ("warning-1" , "warning-2" ))
4444
45- Expect (fakeCloudControllerClient .GetInfoCallCount ()).To (Equal (1 ))
45+ Expect (fakeCloudControllerClient .GetRootCallCount ()).To (Equal (1 ))
4646 Expect (rootInfo .Links .LogCache .HREF ).To (Equal ("some-log-cache-url" ))
4747 })
4848 })
4949
50+ When ("the cloud controller client returns an error" , func () {
51+ var expectedErr error
52+
53+ BeforeEach (func () {
54+ expectedErr = errors .New ("I am a CloudControllerClient Error" )
55+ fakeCloudControllerClient .GetRootReturns (
56+ ccv3.Root {},
57+ ccv3.Warnings {"warning-1" , "warning-2" },
58+ expectedErr ,
59+ )
60+ })
61+
62+ It ("returns the same error and all warnings" , func () {
63+ _ , warnings , err := actor .GetRootResponse ()
64+ Expect (err ).To (MatchError (expectedErr ))
65+ Expect (warnings ).To (ConsistOf ("warning-1" , "warning-2" ))
66+ })
67+ })
68+ })
69+
70+ Describe ("GetInfoResponse" , func () {
71+ When ("getting info is successful" , func () {
72+ BeforeEach (func () {
73+ fakeCloudControllerClient .GetInfoReturns (
74+ ccv3.Info {
75+ Name : "test-name" ,
76+ Build : "test-build" ,
77+ OSBAPIVersion : "1.0" ,
78+ },
79+ ccv3.Warnings {"warning-1" , "warning-2" },
80+ nil ,
81+ )
82+ })
83+
84+ It ("returns all warnings and info" , func () {
85+ info , warnings , err := actor .GetInfoResponse ()
86+ Expect (err ).ToNot (HaveOccurred ())
87+
88+ Expect (warnings ).To (ConsistOf ("warning-1" , "warning-2" ))
89+
90+ Expect (fakeCloudControllerClient .GetInfoCallCount ()).To (Equal (1 ))
91+ Expect (info .Name ).To (Equal ("test-name" ))
92+ Expect (info .Build ).To (Equal ("test-build" ))
93+ Expect (info .OSBAPIVersion ).To (Equal ("1.0" ))
94+ })
95+ })
96+
5097 When ("the cloud controller client returns an error" , func () {
5198 var expectedErr error
5299
@@ -60,7 +107,7 @@ var _ = Describe("Info Actions", func() {
60107 })
61108
62109 It ("returns the same error and all warnings" , func () {
63- _ , warnings , err := actor .GetRootResponse ()
110+ _ , warnings , err := actor .GetInfoResponse ()
64111 Expect (err ).To (MatchError (expectedErr ))
65112 Expect (warnings ).To (ConsistOf ("warning-1" , "warning-2" ))
66113 })
0 commit comments