1 | 1 | | #!/usr/bin/env bats |
2 | 2 | | |
3 | | - | load "test_helper/bats-support/load" |
4 | | - | load "test_helper/bats-assert/load" |
5 | | - | |
6 | | - | foldername="sandboxrepo" |
7 | | - | |
8 | | - | setup() { |
9 | | - | create_git_sandbox |
10 | | - | export BROWSER=echo |
11 | | - | } |
| 3 | + | load "test_helper/index" |
12 | 4 | | |
13 | 5 | | ## |
14 | 6 | | ## Test environment |
| skipped 374 lines |
389 | 381 | | assert_output "http://tfs.example.com:8080/Project/Folder/_workitems?id=36" |
390 | 382 | | } |
391 | 383 | | |
392 | | - | |
393 | | - | teardown() { |
394 | | - | cd .. |
395 | | - | rm -rf "$foldername" |
396 | | - | } |
397 | | - | |
398 | | - | # helper to create a test git sandbox that won't dirty the real repo |
399 | | - | function create_git_sandbox() { |
400 | | - | rm -rf "$foldername" |
401 | | - | mkdir "$foldername" |
402 | | - | cd "$foldername" |
403 | | - | # safety check. Don't muck with the git repo if we're not inside the sandbox. |
404 | | - | assert_equal $(basename $PWD) "$foldername" |
405 | | - | |
406 | | - | git init -q |
407 | | - | assert [ -e "../$foldername/.git" ] |
408 | | - | git config user.email "[email protected]" && git config user.name "Test Runner" |
409 | | - | |
410 | | - | # newer git auto-creates the origin remote |
411 | | - | if ! git remote add origin "github.com:paulirish/git-open.git"; then |
412 | | - | git remote set-url origin "github.com:paulirish/git-open.git" |
413 | | - | fi |
414 | | - | |
415 | | - | git checkout -B "master" |
416 | | - | |
417 | | - | echo "ok" > readme.txt |
418 | | - | git add readme.txt |
419 | | - | git commit -m "add file" -q |
420 | | - | } |
421 | | - | |