diff --git a/features/cli.feature b/features/cli.feature index 3261860..d781555 100644 --- a/features/cli.feature +++ b/features/cli.feature @@ -40,6 +40,15 @@ Feature: CLI When I run "bin/penchant gemfile remote" in the "tmp" directory Then the output should include "git hooks not installed" + Scenario: Run in a project where there are no git hooks, but there is a git repo + Given I have the file "tmp/Gemfile.penchant" with the content: + """ + gem 'rake' + """ + Given I have the directory "tmp/.git" + When I run "bin/penchant gemfile remote" in the "tmp" directory + Then the output should not include "git hooks not installed" + Scenario: Run in a project where git hooks are set up Given I have the file "tmp/Gemfile.penchant" with the content: """ diff --git a/features/step_definitions/given/i_have_the_directory_tmp_git.rb b/features/step_definitions/given/i_have_the_directory_tmp_git.rb new file mode 100644 index 0000000..f77780e --- /dev/null +++ b/features/step_definitions/given/i_have_the_directory_tmp_git.rb @@ -0,0 +1,3 @@ +Given /^I have the directory "(.*?)"$/ do |dir| + FileUtils.mkdir_p dir +end diff --git a/lib/penchant/hooks.rb b/lib/penchant/hooks.rb index 54daf22..8ccb68e 100644 --- a/lib/penchant/hooks.rb +++ b/lib/penchant/hooks.rb @@ -13,6 +13,9 @@ module Penchant return false if !File.expand_path(File.readlink(target)) == File.expand_path(file) end + true + else + # no script/hooks dir, so we must not want them true end end diff --git a/lib/penchant/version.rb b/lib/penchant/version.rb index 31ea7d9..706add5 100644 --- a/lib/penchant/version.rb +++ b/lib/penchant/version.rb @@ -1,3 +1,3 @@ module Penchant - VERSION = "0.2.14" + VERSION = "0.2.15" end