Fantastic and very detailed post on writing and/or refactoring Rspec tests. This is a must read!!
Everyone agrees that writing clean ruby code is essential. There are many blog posts about refactoring your ruby code to make it more readable and maintainable. As tests become a major part of our programming routine, I feel there is a large place for improvement in the way we write and maintain our test-suites. Many ruby projects consist of more rspec lines than actual ruby code, and that requires us to treat our test code with as much care as we treat our actual ruby code, if not even more. Writing specs may be considered by programmers as a burden or a chore if not done the right way. That may cause some programmers to write less specs for their code or to even totally give up on it. Luckily, RSpec provides us with all the tools necessary to create efficient, great looking and fun-to-write specs for our code. I’d…
View original post 1,229 more words