Skip to content

Commit

Permalink
cover some more stuff, silence more git noise
Browse files Browse the repository at this point in the history
  • Loading branch information
benmelz committed Jan 29, 2025
1 parent 9366c66 commit 24a8ff1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions spec/overcommit/hook_context/diff_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
context 'when repo contains no files' do
around do |example|
repo do
`git commit --allow-empty -m "Initial commit"`
`git checkout -b other-branch 2>&1`
example.run
end
Expand Down Expand Up @@ -68,6 +69,7 @@

repo do
`git submodule add #{submodule} test-sub 2>&1 > #{File::NULL}`
`git commit --allow-empty -m "Initial commit"`
`git checkout -b other-branch 2>&1`
example.run
end
Expand Down Expand Up @@ -118,4 +120,24 @@
it { should == Set.new(1..3) }
end
end

describe '#hook_type_name' do
subject { context.hook_type_name }

it { should == 'pre_commit' }
end

describe '#hook_script_name' do
subject { context.hook_script_name }

it { should == 'pre-commit' }
end

describe '#initial_commit?' do
subject { context.initial_commit? }

before { Overcommit::GitRepo.stub(:initial_commit?).and_return(true) }

it { should == true }
end
end

0 comments on commit 24a8ff1

Please sign in to comment.