Upgrade to Pro — share decks privately, control downloads, hide ads and more …

batsを使おう / Let's use bats

cottondesu
September 16, 2018

batsを使おう / Let's use bats

bashのテストフレームワーク「bats」に
ついての簡単な例付きでご紹介

cottondesu

September 16, 2018
Tweet

More Decks by cottondesu

Other Decks in Programming

Transcript

  1. #!/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