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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
22
ヨシケイの撮り忘れを対策した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
370
開発環境公開ハード編 / 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
800
Kanazawa.rb 10周年KPT / Kanazawa.rb 10th Anniversary KPT
cottondesu
0
910
Kanazawa.rb 9周年KPT / Kanazawa.rb 9th Anniversary KPT
cottondesu
0
500
Other Decks in Programming
See All in Programming
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.6k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
JIS keyboard support in Omarchy
lef237
0
140
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
ChromeでローカルLLM
ryu1013
0
140
golang-bob.pdf
iwatsukayura
0
130
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
510
気持ちぃ〜角丸 Squircle
ryu1013
0
320
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
33k
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
APNsからLive Activityを開始する話
yumnumm
0
170
Featured
See All Featured
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
300
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
Optimising Largest Contentful Paint
csswizardry
37
4k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
The Cult of Friendly URLs
andyhume
79
7k
Bash Introduction
62gerente
615
220k
Facilitating Awesome Meetings
lara
57
7.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Building Applications with DynamoDB
mza
96
7.2k
Into the Great Unknown - MozCon
thekraken
41
2.8k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
760
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
500
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ʹΑΔςετϥΠϑΛ࢝Ί·͠ΐ͏ ૯ׅ