I'm not sure you really need to do that. The test case should such that there is only one error message on the page. You can have other tests that check for multiple error messages but there should be one specific to this scenario. Doing that then a test that checks to see if the span.error-text is on the page and that it contains the text can't be blank should be sufficient.
page.should have_selector('span.error-text', text: "can't be blank")