Project

tempgit

0.0
No commit activity in last 3 years
No release in over 3 years
Mechanize temporary Git repositories during testing.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
 Project Readme

TempGit¶ ↑

<img src=“http://travis-ci.org/CodeGnome/tempgit.png” />

Copyright and Licensing¶ ↑

Copyright Notice¶ ↑

Copyright 2011 Todd A. Jacobs
All rights reserved.

Software License¶ ↑

The software is licensed under the GPLv3. The LICENSE is also included in the source tree.

README License¶ ↑

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License

Purpose¶ ↑

Have you ever wanted to exercise some Git functionality in your unit or functional tests? The TempGit gem is designed to make life easier–and your filesystem cleaner–when writing Git-related tests.

Key Features¶ ↑

TempGit has some killer features to ease Git-related testing.

  • Instantiate as many Git repositories as you need for testing, each with its own unique directory context.

  • Doesn’t rely on potentially-shared environment variables for GIT_DIR or GIT_WORK_TREE. Each instance stores its own directory values.

  • Execute arbitrary Git commands in an instantiated context. If Git can run it, TempGit can run it, too.

  • Won’t clutter or clobber your current working directory.

  • Cleans up after itself.

Installation and Usage¶ ↑

This gem has been tested against Ruby 1.9.2. It definitly doesn’t work with Ruby 1.8.7, but patches are welcome.

Installing the Gem¶ ↑

gem install tempgit

Using the Library¶ ↑

require 'tempgit'

Example Usage¶ ↑

repo = TempGit::GitDir.new
puts repo.git('log')

repo.add_new_file
puts repo.git('status')

repo.commit_with_sequence_number
puts repo.git('log')

Further Reading¶ ↑

  1. RubyGems

  2. Git

  3. RSpec