Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
RSpecはじめました
Search
kkabetani
October 19, 2013
Programming
2
480
RSpecはじめました
kanazawa.rb meetup #14 で行われたミニコーナー「Test ! Test !! Test !!!」で発表したスライド
kkabetani
October 19, 2013
Tweet
Share
More Decks by kkabetani
See All by kkabetani
kanazawa.rb Slides
kkabetani
0
200
Other Decks in Programming
See All in Programming
Findy Team+ Awardを受賞したかった!ベストプラクティス応募内容をふりかえり、開発生産性向上もふりかえる / Findy Team Plus Award BestPractice and DPE Retrospective 2024
honyanya
0
140
2025.01.17_Sansan × DMM.swift
riofujimon
2
540
QA環境で誰でも自由自在に現在時刻を操って検証できるようにした話
kalibora
1
140
Jaspr Dart Web Framework 박제창 @Devfest 2024
itsmedreamwalker
0
150
DMMオンラインサロンアプリのSwift化
hayatan
0
180
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
190
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
9
2.3k
Beyond ORM
77web
11
1.6k
20241217 競争力強化とビジネス価値創出への挑戦:モノタロウのシステムモダナイズ、開発組織の進化と今後の展望
monotaro
PRO
0
280
Androidアプリの One Experience リリース
nein37
0
1.2k
いりゃあせ、PHPカンファレンス名古屋2025 / Welcome to PHP Conference Nagoya 2025
ttskch
1
170
はてなにおけるfujiwara-wareの活用やecspressoのCI/CD構成 / Fujiwara Tech Conference 2025
cohalz
3
2.7k
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
67
4.5k
Optimizing for Happiness
mojombo
376
70k
Code Review Best Practice
trishagee
65
17k
Agile that works and the tools we love
rasmusluckow
328
21k
KATA
mclloyd
29
14k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.8k
Docker and Python
trallard
43
3.2k
YesSQL, Process and Tooling at Scale
rocio
170
14k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Facilitating Awesome Meetings
lara
51
6.2k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Transcript
34QFD͡Ί·ͨ͠ LBOB[BXBSCNFFUVQ !LLBCFUBOJ
ࣗݾհ w!LLBCFUBOJ w5PZBNB w+BWBͰ8FCΞϓϦ࡞ͬͯ·͢ w+BWB4DSJQUগʑ w3VCZझຯͰ৮ͬͯ·͢
̏ϲ݄લ wʮͨͷ͍͠3VCZʯΛࣸܦͨ͠ w3VCZPO3BJMTͬͯΈΑ͏͔ͳʔ wLBOB[BXBSCʹॳࢀՃͨ͠
34QFDͬͯԿʁ
࠷ۙ w3VCZPO3BJMTͰΞϓϦ࡞͔ͬͨΒςε τॻ͜͏ʢ࣍5%%ͰͬͯΈΑ͏ʣ w(FN࡞ͬͯΈΑ͏ w%4-ʁԿͦΕʁ໘നͦ͏ wLBOB[BXBSCʹࢀՃָͯ͘͠͠ͳͬͯ ͖ͨ
34QFDͪΐͬͱ ͔͖ͬͯͨ
ͦΜͳ͕ࣗ 34QFDͰษڧ͖ͯ͠ ͨ͜ͱΛൃද͠·͢
34QFDͱͷग़ձ͍ w3VCZPO3BJMTνϡʔτϦΞϧͰࣸ ܦͯ͠ษڧͯͨ͠ͱ͖ 3BJMTW wIUUQSBJMTUVUPSJBMKQ
࠷ॳʹॻ͍ͨ34QFD require 'spec_helper' describe "Static pages" do describe "Home page"
do it "should have the content 'Sample App'" do visit '/static_pages/home' page.should have_content('Sample App') end end end
࠷ॳʹॻ͍ͨ34QFD require 'spec_helper' describe "Static pages" do describe "Home page"
do it "should have the content 'Sample App'" do visit '/static_pages/home' page.should have_content('Sample App') end end end
࠷ॳʹॻ͍ͨ34QFD require 'spec_helper' describe "Static pages" do describe "Home page"
do it "should have the content 'Sample App'" do visit '/static_pages/home' page.should have_content('Sample App') end end end
ϯʁφχίϨʁ w3VCZͬΆ͍͚Ͳ w͜Μͳͷशͬͯͳ͍Μ͚ͩͲ wEFTDSJCF wJU wϒϩοΫʁ
࠷ॳͱʹ͔ࣸ͘ܦ͠ ͯಈ͖ΛݟͯΔ͚ͩ
ࣦഊͯ͠ΔͶ
·ͨࣸܦͯ͠࠶࣮ߦ
ޭͨ͠Ͷ
ࣸܦΛ܁Γฦͨ݁͠Ռ wগͮͭ͠34QFDͷ֓ཁ͕͔͖ͬͯͨ wSBJMTͷಈ͖Λॻ͍ͯςετͯ͠Δͩͳ
ٙͨ͘͞Μग़͖ͯͨ
ٙ wͰɺ͜ΕͲ͏͍͏ಈ͖ʹͳͬͯΔ ͷʁ w3VCZͳͷʁ wEFTDSJCFͱ͔JUͱ͔·ͩΑ͔ͬ͘ ͯͳ͍Μ͚ͩͲ
ͦΜͳͱ͖
LBOB[BXBSC w!:VLJNJUTV@*[BXB͞Μͷൃද w3VCZͰ࡞Δ%4- wIUUQXXXTMJEFTIBSFOFU ZJ[BXBSVCZETM
LBOB[BXBSC w34QFD3VCZͰ࣮͞Εͨ෦ %4- w؆୯ͳίʔυͰ%4-Λઆ໌͍ͯͨͩ͠ ͘
%4-ʂʁ
͋ʂ34QFDϒϩο Ϋͯ͠Δͷ͔
3VCZPO3BJMT ͪΐͬͱஔ͍ͱ͍ͯɺ 34QFD %4- ͷษڧ͠ ͯΈΑ͏
34QFDͱԿ͔ʁ wϓϩάϥϜͷৼ CFIBWJPVS Λه ड़͢ΔͨΊͷυϝΠϯಛԽݴޠ %PNBJO4QFDJpD -BOHVBHF%4- Λఏڙ͢ΔϑϨʔ ϜϫʔΫ
ͬͺΓʂ %4-ͳͷ͔ʂʂ
ιʔεಡΜͰΈΑ͏ w͖ͬͱEFTDSJCFؔͰϒϩοΫΛҾ ʹͯ͠Δͱ͜Ζ͕͋Δͣ wEFTDSJCFͰͻͨ͢Β୳͢
ιʔεಡΜͰΈΑ͏ rspec-core/lib/spec/core/dsl.rb def describe(*args, &example_group_block) RSpec::Core::ExampleGroup.describe(*args, &example_group_block).register end
ιʔεಡΜͰΈΑ͏ rspec-core/lib/spec/core/dsl.rb def describe(*args, &example_group_block) RSpec::Core::ExampleGroup.describe(*args, &example_group_block).register end
ιʔεಡΜͰΈΑ͏ wEFTDSJCFؔݟ͚ͭͨ wҾͰϒϩοΫͯ͠Δ w͕͜͜34QFDͷग़ൃ w%4-͕֬ೝग़དྷͨ
͔͖ͬͯͨ describe Bowling, "#score" do it "returns 0 for all
gutter game" do bowling = Bowling.new 20.times { bowling.hit(0)} bowling.score.should eq(0) end end
͔͖ͬͯͨ describe Bowling, "#score" do it "returns 0 for all
gutter game" do bowling = Bowling.new 20.times { bowling.hit(0)} bowling.score.should eq(0) end end
͔͖ͬͯͨ describe Bowling, "#score" do it "returns 0 for all
gutter game" do bowling = Bowling.new 20.times { bowling.hit(0)} bowling.score.should eq(0) end end
͔͖ͬͯͨ wιʔεΛಡΉ͜ͱͰɺEFTDSJCF͕Կ ͯ͠Δ͔͔ͬͨ wJUԿͯ͠Δ͔͔ͬͨ
·ͱΊ w࠷ॳ34QFD͚ͬͯͨͲɺશવͪΜ Μ͔ΜΜͳঢ়ଶ w%4-Λ͔ͬͯΒɺ%4-ʹ͍ͭͯͬ ͱΓͨ͘ͳͬͨ
·ͱΊ wͪΐ͏Ͳͦͷ࣌ɺݟͯͨ34QFD͕ %4-ͩͱ͍͏͜ͱΛΔ wͦΕ͔Βɺ34QFDͷιʔεಡΜͩ Γɺ34QFDʹ͍ͭͯॻ͔Ε͍ͯΔهࣄ ΛಡΈ͋͞Δ w͖͔͚ͬLBOB[BXBSCͩͬͨ
࣍ wࠓΛ͖͔͚ͬʹ࣍ w%4- w34QFDͬͱਂ͘ w3VCZPO3BJMT w#%% 5%% wωλͨ͘͞Μ͋Δ
͋Γ͕ͱ͏͍͟͝·ͨ͠