Projects STRLCPY git-open Commits d3f5a701
🤬
  • add git-open.bats for general tests. For blaming: https://github.com/paulirish/git-open/blame/7449bfa7e100eb3bdd80058f3e99cfefb255e4f1/test/git-open.bats

  • Loading...
  • Paul Irish committed 6 years ago
    d3f5a701
    1 parent ee213388
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    test/git-open.bats
     1 +#!/usr/bin/env bats
     2 + 
     3 +load "test_helper/index"
     4 + 
     5 +##
     6 +## Test environment
     7 +##
     8 +@test "test environment" {
     9 + assert_equal "$BROWSER" "echo"
     10 + cd ..
     11 + assert [ -e "$foldername" ]
     12 + assert [ -e "$foldername/.git" ]
     13 +}
     14 + 
     15 +##
     16 +## Help
     17 +##
     18 + 
     19 +@test "help text" {
     20 + run ../git-open -h
     21 + assert_output --partial "usage: git open"
     22 +}
     23 + 
     24 +@test "invalid option" {
     25 + run ../git-open --invalid-option
     26 + assert_output --partial "error: unknown option \`invalid-option'"
     27 + assert_output --partial "usage: git open"
     28 +}
     29 + 
     30 +##
     31 +## url handling
     32 +##
     33 + 
     34 +@test "url: insteadOf handling" {
     35 + git config --global url.http://example.com/.insteadOf ex:
     36 + git remote set-url origin ex:example.git
     37 + git checkout -B master
     38 + run ../git-open
     39 + assert_output "http://example.com/example"
     40 +}
     41 + 
     42 + 
     43 + 
Please wait...
Page is in error, reload to recover