Skip to content

Commit

Permalink
ensure that internal methods can't pretend to be git commands
Browse files Browse the repository at this point in the history
Hub::Context methods were public, now they are private. Ensures that
`Hub::Commands.respond_to?` doesn't return true for any of its methods.

Closes mislav#62
  • Loading branch information
mislav committed Nov 6, 2010
1 parent 1642c5e commit 35f72a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/hub/context.rb
Expand Up @@ -2,6 +2,8 @@ module Hub
# Provides methods for inspecting the environment, such as GitHub user/token
# settings, repository info, and similar.
module Context
private

# Caches output when shelling out to git
GIT_CONFIG = Hash.new do |cache, cmd|
result = %x{git #{cmd}}.chomp
Expand Down
4 changes: 4 additions & 0 deletions test/hub_test.rb
Expand Up @@ -685,6 +685,10 @@ def test_no_browser
end
end

def test_context_method_doesnt_hijack_git_command
assert_command 'remotes', 'git remotes'
end

protected

def stub_github_user(name)
Expand Down

0 comments on commit 35f72a5

Please sign in to comment.