Class: EacGit::Rspec::StubbedGitLocalRepo::Repository
- Defined in:
- lib/eac_git/rspec/stubbed_git_local_repo/repository.rb
Constant Summary
Constants inherited from Local
Instance Method Summary collapse
- #directory(*subpath) ⇒ EacGit::Rspec::StubbedGitLocalRepo::Directory
- #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
#directory(*subpath) ⇒ EacGit::Rspec::StubbedGitLocalRepo::Directory
14 15 16 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo/repository.rb', line 14 def directory(*subpath) ::EacGit::Rspec::StubbedGitLocalRepo::Directory.new(self, subpath) end |
#file(*subpath) ⇒ Object
18 19 20 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo/repository.rb', line 18 def file(*subpath) ::EacGit::Rspec::StubbedGitLocalRepo::File.new(self, subpath) end |
#random_commit ⇒ EacGit::Local::Commit
Returns EacGit::Local::Commit.
23 24 25 26 27 28 29 30 |
# File 'lib/eac_git/rspec/stubbed_git_local_repo/repository.rb', line 23 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 |