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
batsを使おう / Let's use bats
Search
cottondesu
September 16, 2018
Programming
360
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
batsを使おう / Let's use bats
bashのテストフレームワーク「bats」に
ついての簡単な例付きでご紹介
cottondesu
September 16, 2018
More Decks by cottondesu
See All by cottondesu
在庫管理・買い物メモを作成中/creating-inventory-management-shopping-list
cottondesu
0
20
ヨシケイの撮り忘れを対策したPart2/measures-were-taken-to-prevent-forgetting-to-pick-up-yoshikei-part2
cottondesu
0
55
ヨシケイの取り忘れ対策した / Measures were taken to prevent forgetting to pick up Yoshikei
cottondesu
0
360
開発環境公開ハード編 / Development environment public hardware version
cottondesu
0
190
開発環境公開ソフト編 / Development environment public software edition
cottondesu
0
190
正規表現で心が折れた/Regular expressions broke my heart
cottondesu
0
190
オレオレGASからMakeへの移行を検討してみた / Considering the transition from Ore Ore GAS to Make
cottondesu
0
790
Kanazawa.rb 10周年KPT / Kanazawa.rb 10th Anniversary KPT
cottondesu
0
900
Kanazawa.rb 9周年KPT / Kanazawa.rb 9th Anniversary KPT
cottondesu
0
500
Other Decks in Programming
See All in Programming
Security issues being discussed on Web Platforms
petamoriken
0
1.3k
wkhtmltopdfの次どうするか問題2026
willnet
2
1.8k
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
270
Workers Cache を知る
syumai
0
310
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
140
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5.2k
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
440
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
570
Agents on Rails - Rails at Scale 2026
irinanazarova
0
290
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
490
GitHubハンズオン講座 — 実務レベルのチーム開発のフローを身につけよう
junhat6
0
110
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
370
Featured
See All Featured
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
290
Designing Powerful Visuals for Engaging Learning
tmiket
1
580
Embracing the Ebb and Flow
colly
88
5.2k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Tell your own story through comics
letsgokoyo
1
1.1k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
540
Product Roadmaps are Hard
iamctodd
55
13k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
380
Making Projects Easy
brettharned
120
6.8k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
590
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
620
How STYLIGHT went responsive
nonsquared
100
6.3k
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ʹΑΔςετϥΠϑΛ࢝Ί·͠ΐ͏ ૯ׅ