
Effective Testing with RSpec 3
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Content
- Cover
- Table of Contents
- Foreword
- Acknowledgments
- From Myron Marston
- From Ian Dees
- Introduction
- How to Use This Book
- Code Snippets
- RSpec and Behavior-Driven Development
- Who We Are
- Who You Are
- A Note on Versions
- Online Resources
- Part I-Getting Started
- 1. Getting Started With RSpec
- Installing RSpec
- Your First Spec
- Understanding Failure
- Sharing Setup (But Not Sandwiches)
- Your Turn
- 2. From Writing Specs to Running Them
- Customizing Your Specs' Output
- Identifying Slow Examples
- Running Just What You Need
- Marking Work in Progress
- Your Turn
- 3. The RSpec Way
- What Your Specs Are Doing for You
- Comparing Costs and Benefits
- Different Types of Specs
- Guidelines
- Part II-Building an App With RSpec 3
- 4. Starting On the Outside: Acceptance Specs
- First Steps
- Deciding What to Test First
- Checking the Response
- Filling In the Response Body
- Querying the Data
- Saving Your Progress: Pending Specs
- Your Turn
- 5. Testing in Isolation: Unit Specs
- From Acceptance Specs to Unit Specs
- Filling In the First Spec
- Handling Success
- Refactoring
- Handling Failure
- Defining the Ledger
- Your Turn
- 6. Getting Real: Integration Specs
- Hooking Up the Database
- Testing Ledger Behavior
- Testing the Invalid Case
- Isolating Your Specs Using Database Transactions
- Filling In the Behavior
- Querying Expenses
- Ensuring the Application Works for Real
- Your Turn
- Part III-RSpec Core
- 7. Structuring Code Examples
- Getting the Words Right
- Sharing Common Logic
- Sharing Example Groups
- Your Turn
- 8. Slicing and Dicing Specs with Metadata
- Defining Metadata
- Reading Metadata
- Selecting Which Specs to Run
- Sharing Code Conditionally
- Changing How Your Specs Run
- Your Turn
- 9. Configuring RSpec
- Command-Line Configuration
- Setting Command-Line Defaults
- Using a Custom Formatter
- RSpec.configure
- Your Turn
- Part IV-RSpec Expectations
- 10. Exploring RSpec Expectations
- Parts of an Expectation
- How Matchers Work
- Composing Matchers
- Generated Example Descriptions
- Your Turn
- 11. Matchers Included in RSpec Expectations
- Primitive Matchers
- Higher-Order Matchers
- Block Matchers
- Your Turn
- 12. Creating Custom Matchers
- Delegating to Existing Matchers Using Helper Methods
- Defining Matcher Aliases
- Negating Matchers
- Using the Matcher DSL
- Defining a Matcher Class
- Your Turn
- Part V-RSpec Mocks
- 13. Understanding Test Doubles
- Types of Test Doubles
- Usage Modes: Mocks, Stubs, and Spies
- Origins: Pure, Partial, and Verifying Doubles
- Your Turn
- 14. Customizing Test Doubles
- Configuring Responses
- Setting Constraints
- Your Turn
- 15. Using Test Doubles Effectively
- Constructing Your Test Environment
- Stubject (Stubbing the Subject)
- Using Partial Doubles Effectively
- Connecting the Test Subject to Its Environment
- The Risks of Mocking Third-Party Code
- High-Fidelity Fakes
- Faking I/O with StringIO
- Wrapping a Third-Party Dependency
- Your Turn
- A1. RSpec and the Wider Ruby Ecosystem
- Bundler
- Rake
- Using Parts of RSpec With Other Test Frameworks
- A2. Using RSpec with Rails
- Installation
- Using rspec-rails
- Spec Types
- Spec Types Cheat Sheet
- Rails Matchers Cheat Sheet
- A3. Matcher Cheat Sheet
- Value Matchers
- Block Matchers
- A4. Bibliography
- Index
- - SYMBOLS -
- - DIGITS -
- - A -
- - B -
- - C -
- - D -
- - E -
- - F -
- - G -
- - H -
- - I -
- - J -
- - K -
- - L -
- - M -
- - N -
- - O -
- - P -
- - Q -
- - R -
- - S -
- - T -
- - U -
- - V -
- - W -
- - X -
- - Y -
System requirements
File format: PDF
Copy-Protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our eBook Help page.