diff --git a/lib/cookbook-omnifetch/git.rb b/lib/cookbook-omnifetch/git.rb index 37985d6..9be0db7 100644 --- a/lib/cookbook-omnifetch/git.rb +++ b/lib/cookbook-omnifetch/git.rb @@ -23,7 +23,7 @@ def initialize(dependency, options = {}) @rel = options[:rel] # The revision to parse - @rev_parse = options[:ref] || options[:branch] || options[:tag] || "master" + @rev_parse = options[:ref] || options[:branch] || options[:tag] || "main" end # @see BaseLoation#installed? diff --git a/spec/unit/git_spec.rb b/spec/unit/git_spec.rb index a80c0fb..9404e70 100644 --- a/spec/unit/git_spec.rb +++ b/spec/unit/git_spec.rb @@ -1,5 +1,6 @@ require "spec_helper" require "cookbook-omnifetch/git" +require "pathname" module CookbookOmnifetch describe GitLocation do @@ -69,9 +70,9 @@ def rev_parse(instance) expect(rev_parse(instance)).to eq("v1.2.3") end - it 'uses "master" when none is given' do + it 'uses "main" when none is given' do instance = described_class.new(dependency, git: "https://repo.com") - expect(rev_parse(instance)).to eq("master") + expect(rev_parse(instance)).to eq("main") end end end