diff --git a/lib/hub/context.rb b/lib/hub/context.rb index 532cc2d66..9e196160c 100644 --- a/lib/hub/context.rb +++ b/lib/hub/context.rb @@ -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 diff --git a/test/hub_test.rb b/test/hub_test.rb index 884201221..2667dbfe9 100644 --- a/test/hub_test.rb +++ b/test/hub_test.rb @@ -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)