Class: EacGit::Rspec::StubbedGitLocalRepo::StubbedGitRepository
- Defined in:
- lib/eac_git/rspec/stubbed_git_local_repo.rb
Constant Summary
Constants inherited from Local
Instance Method Summary collapse
- #file(*subpath) ⇒ Object
-
#random_commit ⇒ EacGit::Local::Commit
EacGit::Local::Commit.
Methods inherited from Local
#<=>, #branch, #command, #commit, #commitize, #current_branch, #descendant?, find, #head, #merge_base, #raise_error, #rev_parse, #subrepo, #subrepos, #to_s
Instance Method Details
#file(*subpath) ⇒ Object
30 31 32 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 30 def file(*subpath) StubbedGitRepositoryFile.new(self, subpath) end |
#random_commit ⇒ EacGit::Local::Commit
Returns EacGit::Local::Commit.
35 36 37 38 39 40 41 42 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo.rb', line 35 def random_commit content = ::SecureRandom.hex file = "#{content}.txt" file(file).write(content) command('add', file).execute! command('commit', '-m', "Random commit: #{file}.").execute! head end |