Questions tagged [gomega]
24 questions
0
votes
1 answer
How do you change the "Cap" value of an []map[string]interface{} in go lang?
I am trying to do some testing with ginkgo and gomega, I get down to the assertion error
Expected
<[]map[string]interface {} | len:1, cap:1>: []
To equal
<[]map[string]interface {} | len:1, cap:4>: []
I believe that the test is…

benwasin97
- 203
- 4
- 12
0
votes
1 answer
async testing with Gingko and Gomega
I have expanded the following code as per my requirement. https://github.com/radovskyb/watcher/blob/master/example/basics/main.go
Purpose of this code is to watch of certain events (CREATE, WRITE) and take appropriate action based on that. To test…

tgcloud
- 857
- 6
- 18
- 37
0
votes
1 answer
Can Someone Verify My Answers on Asymptotic Analysis?
This for a data structures and algorithms course. I am confident in all of them but part d and I am not sure how to approach e. I know for part e, it is the sum of the harmonic series, and our professor told us it is bounded by (ln(n) + 1/n, ln(n) +…

binarycoffee356
- 49
- 1
- 8
0
votes
0 answers
How to match private struct types using Ginkgo and Gomega?
Assume that I have a function called GetQueue with GoLang and depends on the configuration, it would return different types of queue implementations.
func GetQueue(config string) *service.Queue {
switch(config):
case "A":
return…

injoy
- 3,993
- 10
- 40
- 69
0
votes
0 answers
How to list files recursively with go-mega
I'm using a third party library to connect to the mega.nz api and can't figure out a good algorithm to list all files in every directory.
GetChildren could be called on "i" again. But if I do it this way i would just get the files which are on the…

Sansch
- 61
- 1
- 5
0
votes
1 answer
Wrapping httptest methods in a helper function
In my handler tests, I use the pattern of serving a test request with an authentication token in the header a large number of times. To abstract this, and save myself a large number of lines, I've written the following function:
func…

category
- 2,113
- 2
- 22
- 46
0
votes
0 answers
Homework-Prove Big omega with witness
I am having trouble solving a proof. Given the situations : f(x)=x^4-50x^3+1 g(x)=x^4 we need to show that f(x)is big omega of g(x), also need to provide the witness

Jinyu Zhao
- 11
- 1
-1
votes
2 answers
Variable in It spec text always 0 although changed in BeforeEach in ginkgo/gomega
In my code snippet below or https://play.golang.org/p/tLld-zNF2zp, testValue was declared inside Describe block, changed in BeforeEach block. Then, used in.
It
Expect
The test passes as expected. From the debug log, It always shows testValue…

AEWRocks
- 157
- 1
- 2
- 10
-2
votes
1 answer
Test a map[string]interface{} with ginkgo and gomega
During testing I get the error message
Expected
<[]map[string]interface {} | len:0, cap:0>: []
to equal
<[]map[string]interface {} | len:0, cap:0>: nil
How Do i declare a []map[string]interface {} to be "nil"?
thank you

benwasin97
- 203
- 4
- 12