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
batsを使おう / Let's use bats
Search
cottondesu
September 16, 2018
Programming
0
340
batsを使おう / Let's use bats
bashのテストフレームワーク「bats」に
ついての簡単な例付きでご紹介
cottondesu
September 16, 2018
Tweet
Share
More Decks by cottondesu
See All by cottondesu
ヨシケイの撮り忘れを対策したPart2/measures-were-taken-to-prevent-forgetting-to-pick-up-yoshikei-part2
cottondesu
0
35
ヨシケイの取り忘れ対策した / Measures were taken to prevent forgetting to pick up Yoshikei
cottondesu
0
190
開発環境公開ハード編 / Development environment public hardware version
cottondesu
0
160
開発環境公開ソフト編 / Development environment public software edition
cottondesu
0
150
正規表現で心が折れた/Regular expressions broke my heart
cottondesu
0
160
オレオレGASからMakeへの移行を検討してみた / Considering the transition from Ore Ore GAS to Make
cottondesu
0
610
Kanazawa.rb 10周年KPT / Kanazawa.rb 10th Anniversary KPT
cottondesu
0
750
Kanazawa.rb 9周年KPT / Kanazawa.rb 9th Anniversary KPT
cottondesu
0
450
Mac Book Proのバッテリー交換してみた / I replaced the battery in my Mac Book Pro.
cottondesu
0
570
Other Decks in Programming
See All in Programming
高速開発のためのコード整理術
sutetotanuki
1
390
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
6k
「ブロックテーマでは再現できない」は本当か?
inc2734
0
700
CSC307 Lecture 07
javiergs
PRO
0
550
Architectural Extensions
denyspoltorak
0
280
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
Oxlintはいいぞ
yug1224
5
1.3k
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
Apache Iceberg V3 and migration to V3
tomtanaka
0
150
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
5k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
170
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Producing Creativity
orderedlist
PRO
348
40k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
210
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
97
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
310
Transcript
CBUTΛ͓͏ 2018年09月15日 kanazawa.rb meetup#73
!DPUUPO@EFTV ΏΔͬͱ;ΘͬͱอकΤϯδχΞ ׂ৽ن։ൃ ׂอक ػೳՃɺػೳमਖ਼ɺόάमਖ਼ FUD
CBTIॻ͍ͯ·͔͢ʁ
CBTIͰςετ Ͱ͖Δͷͬͯ·͔ͨ͠ʁ
࣮
CBUTͰग़དྷΔΜͰ͢
CBUTͱ
#BTI"VUPNBUFE 5FTUJOH4ZTUFN IUUQTHJUIVCDPNTTUFQIFOTPOCBUT
CBTIͷςετϑϨʔϜϫʔΫ w ରԠ04 "SDI "MQJOF 6CVOUV 'SFF#4%YBOEY NBD04 8JOEPXT
CBUT
Πϯετʔϧ؆୯
Πϯετʔϧ IPNFCSFXͰΠϯετʔϧ CSFXJOTUBMMCBUTDPSF OQNͰΠϯετʔϧ OQNJOTUBMMHCBUT
͍ํ
w !UFTUͷ\^ͷϒϩοΫ͕ςετର w CBUTϑΝΠϧʹهࡌ w CBUTίϚϯυͰCBUTϑΝΠϧΛ࣮ߦ ͍ํ ϧʔϧ
w TIFMMͷಡΈࠐΈTFUVQ ʹهࡌ w SVOϑΝϯΫγϣϯ໊Ͱ࣮ߦ w SVOͷ݁Ռ#BUTͷΈࠐΈมʹೖΔ ͨΊɼҎԼΛςετ݁Ռͱͯ͠༻ ͍ํ ϧʔϧ
w \TUBUVT^εςʔλείʔυ w \PVUQVU^ग़ྗ݁Ռ w \MJOFT^ग़ྗ݁Ռʢྻʣ
࡞ྫ
VTSCJOFOWCBUT !UFTUBEEJUJPOVTJOHCD\ˡ!UFTUͷ\^ͷϒϩοΫ SFTVMU FDIP cCD <SFTVMUFR> ^ !UFTUBEEJUJPOVTJOHED\ SFTVMU
FDIP QcED <SFTVMUFR> ^ BEEJUJPOCBUT
࣮ߦྫ
CBUTBEEJUJPOCBUT 㾎BEEJUJPOVTJOHCDˡ!UFTUͷ\^ͷϒϩοΫ໊ 㾎BEEJUJPOVTJOHED UFTUT GBJMVSFT
失敗例
#!/usr/bin/env bats @test "addition ng" { result="$(echo 2+1 | bc)"
[ "$result" -eq 4 ] } addition_ng.bats
実行例
CBUTBEEJUJPO@OHCBUT ✗BEEJUJPOOH JOUFTUGJMFBEEJUJPO@OHCBUT MJOF A<SFTVMUFR>GBJMFE UFTU GBJMVSF
ෳͷCBUTΛ࣮ߦՄೳ
CBUT CBUT 㾎BEEJUJPOVTJOHCD 㾎BEEJUJPOVTJOHED ✗BEEJUJPOOH JOUFTUGJMFBEEJUJPO@OHCBUT MJOF A<SFTVMUFR>GBJMFE
UFTUT GBJMVSF
TIFMMಡΈࠐΈྫ
#!/bin/sh add() { echo $(($1 + $2)) } add.sh
#!/usr/bin/env bats setup() { . add.sh } @test "input add
eq 3" { run add 1 2 [ "${status}" -eq 0 ] [ "${output}" == "3" ] } @test "input add ng" { run add 1 4 [ "${status}" -eq 0 ] [ "${output}" == "4" ] } add.bats
実行例
CBUTBEECBUT 㾎JOQVUBEEFR ✗JOQVUBEEOH JOUFTUGJMFBEECBUT MJOF A<\PVUQVU^>GBJMFE UFTUT GBJMVSF
%FNP
w Πϯετʔϧ͍ํ؆୯ w ςετίʔυͷॻ͖ํ؆୯ w CBTIʹΑΔςετϥΠϑΛ࢝Ί·͠ΐ͏ ૯ׅ