Join Kevin Skoglund for an in-depth discussion in this video A TDD example: Part three, part of Ruby: Testing with RSpec.
- In this movie, we'll continue…our test driven development example.…We've written test and code for the…first three items on our list.…You might think that we're ready…to move onto item number four…but I noticed something about our test…that we should pause a moment to consider.…It occurred to me that in our previous test…we're setting doors equal to one…and that doesn't really make sense.…It doesn't really match with what our client asked us for.…They said they wanted to know…whether a car was a 2-door coupe…or a 4-door sedan.…
So, it kind of implies that they're expecting it…to be either 2 or 4.…We didn't pick that up in our original specifications…but once I stopped and thought about it…I realized that that is something…that we actually need to have another example for.…So, my solution is that I think if it's not 2 or 4…that it should then default to 4…since 4 is our default.…So, if they give us twenty as the number of doors…we're not gonna accept that.…We're gonna use the default of 4…but if they give us 2 that is acceptable…
Author
Released
2/4/2015- 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
Skill Level Intermediate
Duration
Views
Related Courses
-
Code Clinic: Ruby
with Kevin Skoglund5h 42m Intermediate -
Ruby on Rails 4 Essential Training
with Kevin Skoglund12h 41m Intermediate
-
Introduction
-
Welcome1m 10s
-
-
1. Introducing RSpec
-
What is RSpec?4m 2s
-
Thinking in user stories4m 42s
-
Writing good tests6m 57s
-
-
2. Installation
-
Installing Ruby and RubyGems1m 57s
-
Installing RSpec3m 25s
-
Configuration5m 58s
-
-
3. First Steps and Concepts
-
Basic syntax4m 14s
-
Writing specs5m 18s
-
Running specs7m 27s
-
4. Working with Expectations
-
Fundamentals3m 48s
-
Equivalence matchers7m 3s
-
Truthiness matchers5m 41s
-
Numeric comparison matchers3m 32s
-
Collections6m 13s
-
Other useful matchers7m 44s
-
Predicate matchers5m 14s
-
Observation matchers10m 36s
-
Complex expectations10m 43s
-
-
5. Testing Efficiently
-
Helper methods9m 10s
-
Using the let method7m 36s
-
Setting a subject3m 39s
-
Implicitly defined subjects3m 49s
-
Shared examples10m 36s
-
-
6. Test Doubles
-
What are test doubles?4m 36s
-
Using mocks and stubs8m 38s
-
Partial test doubles6m 12s
-
Message expectations5m 44s
-
Message argument constraints4m 46s
-
Message count constraints3m 53s
-
Spies6m 58s
-
-
7. Challenges
-
Food-finder application6m 8s
-
Challenge: NumberHelper5m 49s
-
Solution: NumberHelper3m 8s
-
Challenge: StringExtend2m 6s
-
Solution: StringExtend3m 48s
-
Challenge: Restaurant5m 25s
-
Solution: Restaurant6m 30s
-
Challenge: Guide12m 49s
-
Solution: Guide6m 41s
-
-
8. RSpec with Ruby on Rails
-
Installing9m 32s
-
Generators4m 46s
-
Test database4m 1s
-
Transactional examples4m 28s
-
Model specs5m 1s
-
Helper specs3m
-
Controller specs: Requests7m 31s
-
View specs7m 12s
-
-
9. Test-Driven Development (TDD)
-
What is TDD?6m 12s
-
A TDD example: Part one4m 43s
-
A TDD example: Part two6m 12s
-
A TDD example: Part three4m 50s
-
A TDD example: Part four7m 47s
-
Benefits and disadvantages8m 36s
-
-
10. Testing Tools
-
Fixtures and factories6m 49s
-
Acceptance testing8m 5s
-
Automatic testing3m 44s
-
Other tools2m 33s
-
-
Conclusion
-
Goodbye31s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: A TDD example: Part three