Sha256: 0ac1328451a55825232f361cad5fcbf2f40a9b7a718a23d43088997cb20c48d6

Contents?: true

Size: 885 Bytes

Versions: 1

Compression:

Stored size: 885 Bytes

Contents

require 'git_shizzle'

describe 'Git repository' do

  let(:git) { GitShizzle::Git::Git.new(repo) }
  subject { GitShizzle::QuickGit.new(git) }

  context 'when invoking a command in a subdirectory of the Git repository' do
    let(:subdir) { 'sub-directory' }
    it 'should succeed' do
      FileUtils.touch 'file'
      FileUtils.mkdir subdir

      Dir.chdir(subdir) do
        subject.run(:track, 1)
      end
    end
  end

  context 'when invoking a command for a file with spaces' do
    it 'should succeed' do
      FileUtils.touch 'file with spaces'

      subject.run(:track, 1)
     end
  end

  context 'when invoking a command outside a Git repository' do
    it 'should fail' do
      FileUtils.rm_rf '.git'
      expect { subject.run(:track) }.to raise_error(GitShizzle::Git::GitExecuteError, /Not a git repository/)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
git_shizzle-0.2.8 spec/git_shizzle/git_spec.rb