I'm trying to test the length of a zip code attribute to ensure its 5 characters long. Right now I'm testing to make sure its not blank and then too short with 4 characters and too long with 6 characters.
Is there a way to test it being exactly 5 characters? So far I've found nothing online or in the rspec book.
There is no more have
matcher in the latest major release of RSpec.
As of RSpec 3.1, the correct way to test this is :
expect("Some string".length).to be(11)