diff --git a/test/git-open.bats b/test/git-open.bats index 32c0fe1..be0119b 100755 --- a/test/git-open.bats +++ b/test/git-open.bats @@ -183,6 +183,19 @@ setup() { assert_output "https://gist.github.com/2d84a6db1b41b4020685" } +@test "gh: --file option" { + run ../git-open -f readme.txt + assert_output "https://github.com/paulirish/git-open/tree/master/readme.txt" + + # and now a new file in a subdirectory. + mkdir -p subdir + touch subdir/howdy.txt + git add subdir + git commit -am add-in-howdy + run ../git-open -f subdir/howdy.txt + assert_output "https://github.com/paulirish/git-open/tree/master/subdir/howdy.txt" +} + @test "basic: # and % in branch names are URL encoded" { # https://github.com/paulirish/git-open/pull/24 git checkout -B "issue-#42"