Rails 5 Test Prescriptions: Build a Healthy Codebase
暫譯: Rails 5 測試處方:建立健康的程式碼庫

Noel Rappin

  • 出版商: Pragmatic Bookshelf
  • 出版日期: 2018-03-27
  • 售價: $1,840
  • 貴賓價: 9.5$1,748
  • 語言: 英文
  • 頁數: 406
  • 裝訂: Paperback
  • ISBN: 1680502506
  • ISBN-13: 9781680502503
  • 相關分類: Ruby
  • 立即出貨 (庫存 < 3)

買這商品的人也買了...

相關主題

商品描述

Does your Rails code suffer from bloat, brittleness, or inaccuracy? Cure these problems with the regular application of test-driven development. You'll use Rails 5.1, Minitest 5, and RSpec 3.6, as well as popular testing libraries such as factory_girl and Cucumber. Updates include Rails 5.1 system tests and Webpack integration. Do what the doctor ordered to make your applications feel all better. Side effects may include better code, fewer bugs, and happier developers.

Your Ruby on Rails application is sick. Deadlines are looming, but every time you make the slightest change to the code, something else breaks. Nobody remembers what that tricky piece of code was supposed to do, and nobody can tell what it actually does. Plus, it has bugs. You need test-driven development: a process for improving the design, maintainability, and long-term viability of software.

With both practical code examples and discussion of why testing works, this book starts with the most basic features delivered as part of core Ruby on Rails. Once you've integrated those features into your coding practice, work with popular third-party testing tools such as RSpec, Jasmine, Cucumber, and factory_girl. Test the component parts of a Rails application, including the back-end model logic and the front-end display logic. With Rails examples, use testing to enable your code to respond better to future change. Plus, see how to handle real-world testing situations.

This new edition has been updated to Rails 5.1 and RSpec 3.6 and contains full coverage of new Rails features, including system tests and the Webpack-based JavaScript setup.

What You Need:

Ruby 2.4, Rails 5.1

商品描述(中文翻譯)

您的 Rails 代碼是否遭遇膨脹、脆弱或不準確的問題?透過定期應用測試驅動開發來治療這些問題。您將使用 Rails 5.1、Minitest 5 和 RSpec 3.6,以及流行的測試庫如 factory_girl 和 Cucumber。更新內容包括 Rails 5.1 系統測試和 Webpack 整合。遵循醫生的建議,讓您的應用程式感覺更好。副作用可能包括更好的代碼、更少的錯誤和更快樂的開發者。

您的 Ruby on Rails 應用程式生病了。截止日期迫在眉睫,但每當您對代碼進行最輕微的更改時,其他地方就會出現問題。沒有人記得那段棘手的代碼應該做什麼,也沒有人能告訴它實際上做了什麼。此外,它還有錯誤。您需要測試驅動開發:一個改善軟體設計、可維護性和長期可行性的過程。

這本書提供了實用的代碼範例,並討論為什麼測試有效,從 Ruby on Rails 的核心功能開始。一旦您將這些功能整合到您的編碼實踐中,便可以使用流行的第三方測試工具,如 RSpec、Jasmine、Cucumber 和 factory_girl。測試 Rails 應用程式的組件部分,包括後端模型邏輯和前端顯示邏輯。透過 Rails 範例,使用測試使您的代碼能更好地應對未來的變更。此外,了解如何處理現實世界的測試情況。

這個新版本已更新至 Rails 5.1 和 RSpec 3.6,並完整涵蓋了新的 Rails 功能,包括系統測試和基於 Webpack 的 JavaScript 設定。

您需要的環境:
Ruby 2.4,Rails 5.1