How to write rspec tests for ruby Script that works with Git -
i have ruby script checks changes between git repo , files @ url endpoints. if changes exist, commits them , pushes them repo. i'd write rspec tests script, i'm having trouble understanding how so, since don't want tests push actual git repo. i'm thinking need set sort of mock repository i'm not entirely sure. suggestions how best write unit tests such script appreciated. i think can make use of fact it's legal push local "bare" repository, i.e. need following steps: create "bare" repository repo1 (i.e. repository, doesn't have working copy, consists entirely of contents of .git folder) clone regular repository repo2 repo1 . make changes in repo2 (add, commit, push). check push successful. check data available in repo1 too. here's sample console session in /tmp directory: ruby-2.2.0 in /tmp ♥ mkdir repo1 ruby-2.2.0 in /tmp ♥ cd repo1 ruby-2.2.0 in /tmp/repo1 ♥ git init --bare initialized empty git reposi...