Skip to content

Commit

Permalink
Tests for version-name and version-origin hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkarns committed Jan 13, 2016
1 parent d3c728e commit 4e26722
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/version-name.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bats

load test_helper

@test 'version-name continues to report default version if no Gemfile' {
run rbenv version-name
assert_success "system"
}

@test 'version-name recognizes ruby version in Gemfile' {
create_version 1.8.7
cd_into_project_with_gemfile "'" 1.8.7
run rbenv version-name
assert_success "1.8.7"
}
14 changes: 14 additions & 0 deletions test/version-origin.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bats

load test_helper

@test 'version-origin continues to report default version if no Gemfile' {
run rbenv version-origin
assert_success "${RBENV_ROOT}/version"
}

@test 'version-origin reports Gemfile if set by Gemfile' {
cd_into_project_with_gemfile "'" 1.8.7
run rbenv version-origin
assert_success "Gemfile"
}

0 comments on commit 4e26722

Please sign in to comment.