Skip to content

Commit a7d0909

Browse files
committed
add a test for new --file option. ref #170
1 parent 866c39d commit a7d0909

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/git-open.bats

+13
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,19 @@ setup() {
183183
assert_output "https://gist.github.com/2d84a6db1b41b4020685"
184184
}
185185

186+
@test "gh: --file option" {
187+
run ../git-open -f readme.txt
188+
assert_output "https://github.com/paulirish/git-open/tree/master/readme.txt"
189+
190+
# and now a new file in a subdirectory.
191+
mkdir -p subdir
192+
touch subdir/howdy.txt
193+
git add subdir
194+
git commit -am add-in-howdy
195+
run ../git-open -f subdir/howdy.txt
196+
assert_output "https://github.com/paulirish/git-open/tree/master/subdir/howdy.txt"
197+
}
198+
186199
@test "basic: # and % in branch names are URL encoded" {
187200
# https://github.com/paulirish/git-open/pull/24
188201
git checkout -B "issue-#42"

0 commit comments

Comments
 (0)