I'm gonna guess this is a client project. My approach would be to write Cucumber tests to cover the behavior of the project only, and then write RSpec implementation tests that cover the new code you'll be writing.
Get the client to sign off on the behavior tests, this way, when you start changing the implementation, you can be sure you haven't drastically modified the behavior of the app. Then, write the tests for the code you wish you had, and refactor until the tests are all green.
发布评论
评论(1)
我猜这是一个客户项目。我的方法是编写 Cucumber 测试来仅覆盖项目的行为,然后编写覆盖您将要编写的新代码的 RSpec 实现测试。
让客户签署行为测试,这样,当您开始更改实现时,您可以确定您没有大幅修改应用程序的行为。然后,为您希望拥有的代码编写测试,并进行重构,直到测试全部通过。
I'm gonna guess this is a client project. My approach would be to write Cucumber tests to cover the behavior of the project only, and then write RSpec implementation tests that cover the new code you'll be writing.
Get the client to sign off on the behavior tests, this way, when you start changing the implementation, you can be sure you haven't drastically modified the behavior of the app. Then, write the tests for the code you wish you had, and refactor until the tests are all green.