Module: EacGit::Rspec::StubbedGitLocalRepo

Defined in:
lib/eac_git/rspec/stubbed_git_local_repo.rb,
lib/eac_git/rspec/stubbed_git_local_repo/file.rb,
lib/eac_git/rspec/stubbed_git_local_repo/directory.rb,
lib/eac_git/rspec/stubbed_git_local_repo/fs_object.rb,
lib/eac_git/rspec/stubbed_git_local_repo/repository.rb

Defined Under Namespace

Classes: Directory, File, FsObject, Repository

Instance Method Summary collapse

Instance Method Details

#stubbed_git_local_repo(bare = false) ⇒ Object

rubocop:disable Style/OptionalBooleanParameter



9
10
11
12
13
14
15
16
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 9

def stubbed_git_local_repo(bare = false) # rubocop:disable Style/OptionalBooleanParameter
  path = ::Dir.mktmpdir
  ::EacRubyUtils::Envs.local.command(stubbed_git_local_repo_args(path, bare)).execute!
  repo = ::EacGit::Rspec::StubbedGitLocalRepo::Repository.new(path)
  repo.command('config', 'user.email', '[email protected]').execute!
  repo.command('config', 'user.name', 'The User').execute!
  repo
end