File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1130,3 +1130,29 @@ func Test_Arguments_Bool(t *testing.T) {
11301130 assert .Equal (t , true , args .Bool (2 ))
11311131
11321132}
1133+
1134+ func Test_WaitUntil_Parallel (t * testing.T ) {
1135+
1136+ // make a test impl object
1137+ var mockedService * TestExampleImplementation = new (TestExampleImplementation )
1138+
1139+ ch1 := make (chan time.Time )
1140+ ch2 := make (chan time.Time )
1141+
1142+ mockedService .Mock .On ("TheExampleMethod2" , true ).Return ().WaitUntil (ch2 ).Run (func (args Arguments ) {
1143+ ch1 <- time .Now ()
1144+ })
1145+
1146+ mockedService .Mock .On ("TheExampleMethod2" , false ).Return ().WaitUntil (ch1 )
1147+
1148+ // Lock both goroutines on the .WaitUntil method
1149+ go func () {
1150+ mockedService .TheExampleMethod2 (false )
1151+ }()
1152+ go func () {
1153+ mockedService .TheExampleMethod2 (true )
1154+ }()
1155+
1156+ // Allow the first call to execute, so the second one executes afterwards
1157+ ch2 <- time .Now ()
1158+ }
You can’t perform that action at this time.
0 commit comments