DHH on Unit Testing : Is RSpec indeed needlessly complicated?

前端 未结 3 1475
一生所求
一生所求 2021-02-08 08:15

I happen to be a subscriber of Ruby Inside, since I\'m particularly interested in Rails. Yesterday, the creator of Rails, David Heinemeier Hansson, pretty much said that he\'s j

3条回答
  •  生来不讨喜
    2021-02-08 08:30

    It's all about semantics. RSpec and Test::Unit are similar functionally. Personally I've always preferred RSpec because I found it more natural to write tests using it. I also like the simplicity of writing custom matchers, and the default matchers provided are useful.

    Cucumber is a different beast entirely. Yes it's fairly cumbersome and becomes hard to maintain if you don't organise your step definitions properly but it does have one very strong use case and that is when your client is writing your specifications.

    I've worked on projects where the client has been writing Cucumber scenarios together with one of our QA team. As a non-technical person it's an extremely approachable and natural way to specify user stories in the code. Cucumber really helped us walk the walk when it came to following our agile practices. The quality of the end product benefitted from that but no I do not like Cucumber as a developer :)

提交回复
热议问题