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
Faking it. Improving tests for external services
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Brian Dear
August 23, 2013
Programming
44
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Faking it. Improving tests for external services
An internal presentation for Take the Interview
Brian Dear
August 23, 2013
Other Decks in Programming
See All in Programming
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
180
Domain-Driven Transformation
hschwentner
2
2.3k
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
190
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
270
気持ちぃ〜角丸 Squircle
ryu1013
0
310
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
290
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
160
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
610
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Paper Plane
katiecoart
PRO
5
54k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
630
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
380
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
400
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
New Earth Scene 8
popppiees
4
2.7k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Transcript
Faking it. How to improve test accuracy and simplify testing
external services.
What is a Fake?
A Fake is an embedded Sinatra application that runs during
a test.
The test itself is unaware that it’s running against a
Fake.
The tests call these endpoints as if they were the
“real” API.
Eliminates need for mocking or stubbing API calls.
Now for an example...
None
None
Fakes are placed in spec/support or test/support. For cucumber, (Ensure
that spec/support or test/support is required somewhere in the cucumber configs.)
Disco time! https://github.com/thoughtbot/capybara_discoball
None
None
None
None
None
Why this is awesome
This (in the Fake)
Can come from this..
So our tests will actually test.
Here’s a working example using Braintree. https://github.com/thoughtbot/fake_braintree We can simply
modify this...
...and we’re done.