mercredi 16 mai 2018

Is Ruby "assert_equal" or "assert_equal" possible

I am creating an assertion test that will be equal to one of two things. Which one I wont know. So is it possible that the first assertion fails and then looks at the next one.

My code currently looks something like this. It doesn't work but it might give you an idea of what Im trying to do.

asset_one = Cache.asset_one
asset_two = Cache.asset_two

assert_equal(asset_one.name, Pages.name) or 
assert_equal(asset_two.name, Pages.name)

The "Pages.name" will definitely match one of them. I just don't which one. If it doesn't match the first. Then I want it to skip it and try match the second.

Any help is as always much appreciated.

Aucun commentaire:

Enregistrer un commentaire