From 6407e25aa43d06adfc3010e8c66d4f93d824cc91 Mon Sep 17 00:00:00 2001 From: Vince Broz Date: Sat, 4 Jan 2020 20:58:50 -0500 Subject: [PATCH] Make Pronto::Git::Patch#new_file_path public Fixes #366 --- lib/pronto/git/patch.rb | 2 -- spec/pronto/git/patch_spec.rb | 10 ++++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/pronto/git/patch.rb b/lib/pronto/git/patch.rb index f994ddf7..2ea3e65e 100644 --- a/lib/pronto/git/patch.rb +++ b/lib/pronto/git/patch.rb @@ -37,8 +37,6 @@ def new_file_full_path repo.path.join(new_file_path) end - private - def new_file_path delta.new_file[:path] end diff --git a/spec/pronto/git/patch_spec.rb b/spec/pronto/git/patch_spec.rb index 144a9dd0..a6129b77 100644 --- a/spec/pronto/git/patch_spec.rb +++ b/spec/pronto/git/patch_spec.rb @@ -36,6 +36,16 @@ module Git let(:repo) { double(path: Pathname.new('/house/of/cards')) } its(:to_s) { should == '/house/of/cards/test.md' } end + + describe '#new_file_path' do + subject { patch.new_file_path } + + let(:rugged_patch) do + double(delta: double(new_file: { path: 'test.md' })) + end + let(:repo) { double(path: Pathname.new('/house/of/cards')) } + its(:to_s) { should == 'test.md' } + end end end end