Skip to content

Instantly share code, notes, and snippets.

@lamchau
Last active March 4, 2016 22:07
Show Gist options
  • Save lamchau/f846cef7754f6041a8a8 to your computer and use it in GitHub Desktop.
Save lamchau/f846cef7754f6041a8a8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bats
load 'test_helper/bats-support/load'
load 'test_helper/bats-assert/load'
print_horizontal_rule () {
let width="$(tput cols)"
# echo -n '─' | hexdump -C
printf -v dash "%b" "\xe2\x94\x80" && printf "%*s\n" "$width" | sed "s/ /${dash}/g"
}
# test
@test "header format uses a native line-drawing character" {
run printf "%s" "$(print_horizontal_rule)"
assert_line --index 0 --partial "─────"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment