Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
TDD Talk Slides
Search
Damir
December 29, 2015
93
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TDD Talk Slides
A short overview of various test double helpers provided by RSpec
Damir
December 29, 2015
Transcript
6 slides
Gentle Isolation
double A simple object that stands in place of any
other object. (Think of stunt doubles)
instance_double A simple object that stands in place of an
object. It verifies that the described double matches the object it stands for. (Verifying double)
mock_model A test double object expanded with ActiveModel and ActiveRecord
API. Includes real functionality of AM/AR methods. Good for testing interactions with AR/AM objects.
stub_model The real AR/AM object, with some mechanisms stubbed. Builds
on top of the existing models, uses the real app code. Good for state-based tests. WARNING: In some cases can result in the actual DB calls.
build_stubbed The real AR object that's build with FactoryGirl. If
FactoryGirl defines dependencies they will be created. Only persistence mechanisms are stubbed.
More Decks by Damir
See All by Damir
A Tool Belt of a Seasond Bug Hunter
damir
0
100
Teaching Programming through Game Development
damir
0
120
1 + 1 = OVER 9000!!!
damir
0
120
Rails Stack Overview
damir
1
130
OOP and FP: Bridging the Gap
damir
0
140
Did We Forget the Benefits of RDBMS?
damir
1
110
Ruby on Rails kurs: instalacija
damir
0
180
I don't like Rails anymore: an exploration of web application architecture design with Ruby
damir
0
530
Lotus.rb
damir
2
350
Featured
See All Featured
Mind Mapping
helmedeiros
1
440
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
550
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.4k
A Soul's Torment
seathinner
9
3.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Designing Powerful Visuals for Engaging Learning
tmiket
1
660
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
My Coaching Mixtape
mlcsv
0
390
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
570
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.6k