Sha256: 127ba78ed63d762091bbcf4a3e1dbca3bbc7d053f939a671a071648a4ca0fb82
Contents?: true
Size: 1.09 KB
Versions: 13
Compression:
Stored size: 1.09 KB
Contents
require 'fedux_org/stdlib/filesystem' module LocalPac module SpecHelper module GitHelper include FeduxOrg::Stdlib::Filesystem def root_directory ::File.expand_path('../../../', __FILE__) end def git_init(path) switch_to_working_directory do Git.init(path) end File.join(working_directory, path) end def git_add(repo, object) Dir.chdir(::File.join(working_directory, repo)) do Git.add(object) end File.join(working_directory, repo, object) end def git_status(repo) Dir.chdir(::File.join(working_directory, repo)) do Git.status end end def git_commit(repo, message = 'Yay... Added objects') Dir.chdir(::File.join(working_directory, repo)) do Git.commit(message) end end def git_show(repo, sha) Dir.chdir(::File.join(working_directory, repo)) do Git.show(sha) end end end end end # encoding: utf-8 RSpec.configure do |c| c.include LocalPac::SpecHelper::GitHelper end
Version data entries
13 entries across 13 versions & 1 rubygems