Understanding RSpec

When do I use it? How do I even understand how to write good RSpecs?
I feel like everything I do is just easier to write the code and see if it works then writing a test the tends to fail more often than my code does.
Does anyone have any good advice on formulating these good testing practices properly?

1 thought on “Understanding RSpec”

  1. > I feel like everything I do is just easier to write the code and see if it works then writing a test the tends to fail more often than my code does.

    This may be faster but taking a longer term view at it, if your code is not easy to test and verify, then maintaining it becomes a large challenge too. Getting a specific behavior to work as quickly as possible is usually not hard, implementing it in a way that can be extended is where I find the most value in testing.

    Personally not a huge test first guy, I like to spike on what I want get it roughly working and then start laying down specs and tightening things up. Sometimes while writing my tests I realize I need to rethink certain parts of my original approach and that’s wonderful.

    Reply

Leave a Comment