From 3c8f067a525958db033150107976023d31b69180 Mon Sep 17 00:00:00 2001 From: Pranay Singh <73547201+i5pranay93@users.noreply.github.com> Date: Mon, 6 Jun 2022 12:23:25 +0530 Subject: [PATCH] changing revision to parse default as main from master (#44) * changing revision to parse default as main from master * adding `pathname` lib to fix failing rspec test Signed-off-by: Pranay Singh --- lib/cookbook-omnifetch/git.rb | 2 +- spec/unit/git_spec.rb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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