Special offers now — see discounted courses.
day
:
hour
:
min
:
sec
See special offers
Ruby: Testing with RSpec

Ruby: Testing with RSpec

6h 14mIntermediate2015-02-04

Authors

Kevin Skoglund

Kevin Skoglund

Founder of NovaFabrica

Course details

Learn how to use RSpec, the Ruby testing framework that can help developers be more productive, write better code, and reduce bugs during development. Kevin Skoglund explains the basic syntax of RSpec and then dives straight into writing and running test examples. He shows how to use a variety of matchers to test for expected conditions, provides techniques for testing efficiently, and demonstrates how test doubles can stand in for objects and methods. He also explains the additional RSpec features available for Ruby on Rails, and walks through a step-by-step example of test-driven development.

Learning objectives
Installing and configuring RSpec
Writing and running examples
Defining expectations using matchers
Using helper methods, before/after hooks, and shared examples
Creating test doubles using mocks and stubs
Testing Ruby on Rails with RSpec
Putting test-driven development into practice

Skills covered

RubySoftware TestingOpen SourceSoftware DevelopmentDeep Dive (X:Y)

Concepts

0. Introduction

  • 01 - Welcome
  • 02 - How to use the exercise files

1. Introducing RSpec

  • 03 - What is RSpec
  • 04 - Why software tests are important
  • 05 - Thinking in user stories
  • 06 - Writing good tests

2. Installation

  • 07 - Installing Ruby and RubyGems
  • 08 - Installing RSpec
  • 09 - Configuration

3. First Steps and Concepts

  • 10 - Target code and the spec file
  • 11 - Basic syntax
  • 12 - Writing specs
  • 13 - Running specs
  • 14 - Skipping examples and working with pending examples

4. Working with Expectations

  • 15 - Fundamentals
  • 16 - A deprecated modifier - should
  • 17 - Equivalence matchers
  • 18 - Truthiness matchers
  • 19 - Numeric comparison matchers
  • 20 - Collections
  • 21 - Other useful matchers
  • 22 - Predicate matchers
  • 23 - Observation matchers
  • 24 - Complex expectations

5. Testing Efficiently

  • 25 - Helper methods
  • 26 - Hooks - before, after, and around
  • 27 - Using the let method
  • 28 - Setting a subject
  • 29 - Implicitly defined subjects
  • 30 - Shared examples

6. Test Doubles

  • 31 - What are test doubles
  • 32 - Using mocks and stubs
  • 33 - Partial test doubles
  • 34 - Message expectations
  • 35 - Message argument constraints
  • 36 - Message count constraints
  • 37 - Spies

7. Challenges

  • 38 - Food-finder application
  • 39 - Challenge - NumberHelper
  • 40 - Solution - NumberHelper
  • 41 - Challenge - StringExtend
  • 42 - Solution - StringExtend
  • 43 - Challenge - Restaurant
  • 44 - Solution - Restaurant
  • 45 - Challenge - Guide
  • 46 - Solution - Guide

8. RSpec with Ruby on Rails

  • 47 - Installing
  • 48 - Generators
  • 49 - Test database
  • 50 - Transactional examples
  • 51 - Model specs
  • 52 - Helper specs
  • 53 - Controller specs - Requests
  • 54 - Controller specs - Responses
  • 55 - View specs

9. Test-Driven Development (TDD)

  • 56 - What is TDD
  • 57 - A TDD example - Part one
  • 58 - A TDD example - Part two
  • 59 - A TDD example - Part three
  • 60 - A TDD example - Part four
  • 61 - Benefits and disadvantages

10. Testing Tools

  • 62 - Fixtures and factories
  • 63 - Acceptance testing
  • 64 - Automatic testing
  • 65 - Other tools

Conclusion

  • 66 - Goodbye

Related courses

Related learn paths

About us

LyndaKade is a leading learning platform that helps people learn business, software, technology, and creative skills to achieve personal and professional goals.

Phone numberAparat ChannelTelegram SupportTelegram ChannelInstagram Page

All rights to this site belong to LyndaKade.

Terms of Service|Privacy Policy

نماد الکترونیک enamad در صورت اتصال با آی‌پی داخل کشور، نمایش داده خواهد شد.
logo-samandehi - لوگو ساماندهی
zarinpal
zibal