简体   繁体   English

是否正在使用Michael Hartl的Ruby on Rails教程所需的rspec?

[英]Is using rspec required for Michael Hartl's Ruby on Rails tutorial?

I'm going through his tutorial, which calls for the use of rspec. 我正在阅读他的教程,该教程要求使用rspec。 To make it through his tutorial do I need to do any of the rspec steps, or can I skip them? 要通过他的教程,我需要执行任何rspec步骤,还是可以跳过它们?

More importantly, what is rspec, and what are the benefits? 更重要的是,什么是rspec,有什么好处?

I come from a very loose PHP world. 我来自一个非常宽松的PHP世界。 I've never worked with a framework before, and all testing has just been manual testing on a local server before launching to production. 我之前从未使用过框架,所有测试都是在启动生产之前在本地服务器上进行手动测试。 I get the benefits of a testing application, I just don't know that I'll ever actually use it. 我得到了测试应用程序的好处,我只是不知道我会实际使用它。

If you can convince me (not that I'm asking you to), I'm really good at following the path of reason and logic. 如果你能说服我(不是我要求你),我真的很擅长遵循理性和逻辑的道路。

You can skip them by ignoring parts talking about tests. 您可以通过忽略谈论测试的部分来跳过它们。

I however strongly advise you to at least take a look at how it works. 但是我强烈建议你至少看看它是如何工作的。

If you want to develop a production site, being able to tell that your core functions are working as you expect them to is priceless (Cart management for an e-commerce website for example). 如果您想开发一个生产站点,能够告诉您的核心功能正如您所期望的那样是无价的(例如,电子商务网站的购物车管理)。

So each time you change something in your app, all you have to do is execute your tests and you'll know that the core of your application works as expected (well, if you wrote good tests, that is). 因此,每当您在应用程序中更改某些内容时,您所要做的就是执行测试,并且您将知道应用程序的核心是按预期工作的(好吧,如果您编写了良好的测试,那就是)。

If you don't have tests, you'll just end up losing time browser-testing every page when doing major modifications to your code base. 如果您没有进行测试,那么在对代码库进行重大修改时,您最终会失去浏览器测试每个页面的时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM