"RSpec syntax is so confusing"

RSpec tests often seem to be an indecipherable soup of brackets, parentheses, and mysterious keywords.

How do you know where to put a dot and where to put a space? Is it .to eq(true) or .to.eq(true)?

What's the difference between describe and context?

Is this syntax made out of functions or variables or some kind of weird magic you don't even know about? What exactly is a DSL, anyway?

What if you didn't have to think about the syntax and you could just focus on writing tests?

Imagine if you didn't have to waste brainpower on thinking about RSpec syntax. Instead, you'd have an idea for a test, and you'd write the test, just how you do for regular old Ruby code.

Imagine if you were as fluent in RSpec's DSL as you were in Ruby itself, and you never (or at least rarely) had to google to remind yourself what the syntax is.

Intro to RSpec Syntax can help you achieve this.

Introducing: Intro to RSpec Syntax

Ebook + Video Package, 61 Pages, 10 Videos

Addresses your most acute RSpec confusions

  • RSpec's domain-specific language (DSL) explained in detail
  • Ruby blocks and how they're used in RSpec
  • The structural components of an RSpec test
  • Matchers (e.g. eq and be) and when to use them
  • The expect keyword and how it works
  • The difference between let, let! and instance variables

Table of Contents

    1. Introduction: an overview of what you can expect to get out of the course.
    2. The Structure of a Test: shows the four phases that are typical of any test in any language or framework.
    3. Understanding Blocks: shows exactly how Ruby blocks work, which are a fundamental component of RSpec's domain-specific language.
    4. Let, Let! and Instance Variables: shows the different ways of setting up test data as well as the pros and cons of each.
    5. The Parts of an RSpec Test: dissects the syntax of a typical RSpec test.
    6. Build Your Own RSpec, Part 1: builds deep understanding by taking you through the process of building your own RSpec-like framework.
    7. Build Your Own RSpec, Part 2: a continuation of part 1.
    8. Describe and Context: explains the difference between describe and context and when to use each.
    9. Mocks and Stubs: explains the difference between mocks and stubs, including examples of each.
    10. Where to Learn More: a list of resources for learning more about Rails testing.

Purchase Intro to RSpec Syntax

Choose a package below to get instant access to Intro to RSpec Syntax

Professional Package

Book + Videos + Slack

  • The 61-page book in PDF, EPUB and MOBI
  • 10 video walkthroughs so you never get stuck
  • Slack access - chat with other Rails devs about RSpec
Buy Now ($89)
Comes with 100% money-back guarantee

Basic Package

Just the Book

  • The 61-page book in PDF, EPUB and MOBI
  • 10 video walkthroughs so you never get stuck
  • RTFB Slack access - chat with other Rails devs about testing
Buy Now ($49)
Comes with 100% money-back guarantee

Bonus Package

Book + Videos + Slack + RTFB

  • The 61-page book in PDF, EPUB and MOBI
  • 10 video walkthroughs so you never get stuck
  • Slack access - chat with other Rails devs about RSpec
  • Rails Testing For Beginners - 189-page book + 11 videos
Buy Now ($129)
Comes with 100% money-back guarantee

FAQs

How long is the book?

The book is 61 pages long.

What's the format of the book?

When you purchase, you get a zip file containing PDF, EPUB and MOBI formats. No print version as of now.

How many videos are there, and how long are they?

There are 10 videos. They're just a few minutes each. The longest one is 13 minutes.

What if I buy it and I don’t like it? Do I get my money back?

Yes. I offer a 100% no-questions-asked money-back guarantee.

About the Author

I'm Jason Swett. I'm a developer, speaker, trainer, author and host of The Rails with Jason Podcast.

I've taught programming classes and given tech talks all over the US and the world, including conferences like RailsConf, RubyConf India and RubyHACK. My corporate teaching clients have included Deloitte, VMware, Liberty Mutual and HP.

I've spoken or taught in the US, India, Nigeria, Bulgaria and the Netherlands.