How to make scenario fail, if particular condition does not occurs?

23 views
Skip to first unread message

Aravind A

unread,
Jul 27, 2015, 8:05:56 AM7/27/15
to calabash-android
Hi,

I have scenario for array validation. If array contain any duplicate values, I want to make scenario failure!!!

Is it possible?

nwMike

unread,
Jul 28, 2015, 2:17:51 PM7/28/15
to calabash-android, ara...@ec.is
This isn't really a calabash question, but a test validation question.  You can use RSpec Expectations for this type of validation.  You can use the uniq method as described here: http://stackoverflow.com/questions/4351390/how-do-i-check-an-array-for-duplicates
Combine that with an RSpec matcher: https://www.relishapp.com/rspec/rspec-expectations/v/2-2/docs/matchers/be-matchers and you have achieved your goal.
Reply all
Reply to author
Forward
0 new messages