Instant RSpec Test - Driven Development How-to
Charles Feduke
- 出版商: Packt Publishing
- 出版日期: 2013-07-04
- 售價: $1,000
- 貴賓價: 9.5 折 $950
- 語言: 英文
- 頁數: 68
- 裝訂: Paperback
- ISBN: 1782165223
- ISBN-13: 9781782165224
-
相關分類:
Ruby
海外代購書籍(需單獨結帳)
買這商品的人也買了...
-
$2,010$1,910 -
$1,750$1,663
相關主題
商品描述
Learn RSpec and redefine your approach towards software development
Overview
- Learn something new in an Instant! A short, fast, focused guide delivering immediate results
- Learn how to use RSpec with Rails
- Easy to read and grok examples
- Write idiomatic specifications
In Detail
RSpec is a behaviour driven development framework for Ruby programmers. It comes integrated with its own mocking framework based on Jmock. This book introduces you to RSpec helping you to write idiomatic specifications for Ruby code in a test first approach.
Instant RSpec Test-Driven Development How-to is filled with examples of actual code accompanied by explanations and covers general Ruby, Rails, and RSpec use cases plus a few of the more advanced topics. RSpec Test Driven Development is written on the premise that you will need no experience with RSpec and limited experience with Ruby, Rails, and TDD fundamentals. You’ll begin by writing a very simple Ruby library in true TDD fashion and and use the red, green, refactor tools to migrate this library into a Rails application.
Instant RSpec Test-Driven Development How-to will teach you the actual steps performed in writing an idiomatic specification. You will be able to write a test for the code you wish you had, and learn to write only the minimum code necessary to pass a test, and write more specifications to drive out the production functionality your application will need. Through the course of the book, you will convert a Ruby program into a new Rails application, test Rails specifics such as file uploads, cookies, and model validation and even learn how to use Capybara. RSpec Test Driven Development will help you build confidence in the code they you write and spend less time dealing with bugs and maintenance headaches.
What you will learn from this book
- RSpec fundamentals
- How to use RSpec and Rails together
- Modify your behavior to create tests first and run your specs with every code change
- How to work with the rspec command line tool
- Using mocks and stubs to decouple tests from the database
- How to refactor code to improve readability
Approach
Filled with practical, step-by-step instructions and clear explanations for the most important and useful tasks. A concise guide that delivers immediate results with practical recipes on learning practical hints.
Who this book is written for
This book is aimed at Ruby developers with beginner level expertise who want to use RSpec and test driven development methodology to improve the code they write. Experienced programmers new to Ruby will also benefit from this book which also covers creating testable, idiomatic Ruby code.
商品描述(中文翻譯)
學習 RSpec 並重新定義您對軟體開發的方法
概述:
- 立即學習新知識!一本短小、快速、專注的指南,能立即帶來成果
- 學習如何在 Rails 中使用 RSpec
- 易於閱讀和理解的範例
- 撰寫符合慣用法的規格
詳細內容:
RSpec 是一個針對 Ruby 程式設計師的行為驅動開發框架。它內建了基於 Jmock 的模擬框架。本書將介紹 RSpec,幫助您以測試為先的方式撰寫符合慣用法的 Ruby 代碼規格。
《Instant RSpec Test-Driven Development How-to》充滿了實際程式碼範例,並附有解釋,涵蓋了一般的 Ruby、Rails 和 RSpec 使用情境,以及一些更進階的主題。本書假設您對 RSpec 沒有經驗,對 Ruby、Rails 和 TDD 基礎知識有限。您將從以真正的 TDD 方式撰寫一個非常簡單的 Ruby 函式庫開始,並使用紅綠重構工具將此函式庫遷移到一個 Rails 應用程式中。
《Instant RSpec Test-Driven Development How-to》將教您撰寫符合慣用法的規格所需的實際步驟。您將能夠為您希望擁有的程式碼撰寫測試,並學習僅撰寫最少必要的程式碼以通過測試,並撰寫更多的規格來驅動應用程式所需的產品功能。在本書的過程中,您將把一個 Ruby 程式轉換為一個新的 Rails 應用程式,測試 Rails 的特定功能,如檔案上傳、Cookie 和模型驗證,甚至學習如何使用 Capybara。RSpec Test Driven Development 將幫助您建立對自己所撰寫的程式碼的信心,並減少處理錯誤和維護困擾所需的時間。
本書將學到的內容:
- RSpec 基礎知識
- 如何將 RSpec 與 Rails 一起使用
- 修改行為以先撰寫測試,並在每次程式碼更改時執行規格
- 如何使用 rspec 命令行工具
- 使用模擬和存根將測試與資料庫解耦
- 如何重構程式碼以提高可讀性
方法:
本書提供了實用的、逐步指示和清晰解釋,針對最重要和最有用的任務。這是一本簡潔的指南,能立即帶來成果,並提供了學習實用提示的實際範例。
本書適合對 Ruby 有初級程度專業知識的開發人員,他們希望使用 RSpec 和測試驅動開發方法來改進他們所撰寫的程式碼。對於新接觸 Ruby 的有經驗的程式設計師,本書也涵蓋了創建可測試、符合慣用法的 Ruby 程式碼的內容。