开发者

how can I can get good (or just ok) at BDD for Rails using RSpec?

I already asked a similar question on StackOverflow, and I got a very satisfactory answer. I am trying to get good at testing Ruby on Rails applications with RSpec this time and just doing it doesn't work as mean to getting good (at least not for me).

There are too much things I don't know:

  • what is a mock?
  • what is a stub?
  • how to test views?

Those are only three things I don't know. And while developing an app, too often I arrive at a point where I know that I need to test something and I don't know how to write a test for it...

So my question is: how can I can get good (or just ok) at BDD for Rails using RSpec?

A couple of things to mention though:

  • I hate Cucumber. It's way to verbose for my taste.
  • I already followed the Ruby on Rails Tutorial by Michael Hartl. It taught开发者_高级运维 me a lot indeed.
  • I am in the process of writing my first rails application which is a Tumblr clone.
  • I already bought The RSpec Book and I am waiting for my copy to arrive. Unfortunately it covers a lot of Cucumber.


As a beginner I learned (still learning) rspec by looking at other people's rspecs. Find a large project(eg. https://github.com/diaspora/diaspora) with and see how other people approached the rspec .

To find everything at a single place, below given link is quite helpful :

http://kerryb.github.com/iprug-rspec-presentation/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜