提交 35f72a5b 编写于 作者: M Mislav Marohnić

ensure that internal methods can't pretend to be git commands

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 #62
上级 1642c5e2
......@@ -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
......
......@@ -685,6 +685,10 @@ config
end
end
def test_context_method_doesnt_hijack_git_command
assert_command 'remotes', 'git remotes'
end
protected
def stub_github_user(name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册