Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Issue #7 removing dependencies on local git repository for git commands

  • Loading branch information...
commit a98fd0f32c61fda2524aec3a2843c9db6b2942c1 1 parent c5b5861
@robertgreiner authored
View
18 spec/commands/git/files_changed_spec.rb
@@ -3,7 +3,21 @@
describe "git show --numstat" do
it "should return detailed information about a specified commit" do
- files_changed = FilesChanged.new("d229f066bec91f6fc80448f707e7b070c1791631").list
- files_changed.include?("Robert").should be true
+ files_changed = double("FilesChanged")
+ files_changed.stub(:list).and_return fake_change_list
+ files_changed.list.include?("Robert").should be true
end
end
+
+def fake_change_list
+ list = 'commit d229f066bec91f6fc80448f707e7b070c1791631
+Author: Robert Greiner <robert@robertgreiner.com>
+Date: Tue Jan 10 15:09:46 2012 -0600
+
+ Execute git command to get the hash of the latest commit in the repository.
+
+6 0 lib/tipster/commands/git/latest_commit.rb
+10 0 spec/commands/git/latest_commit_spec.rb
+4 0 spec/helper.rb
+'
+end
View
8 spec/commands/git/latest_commit_spec.rb
@@ -2,7 +2,13 @@
describe "The latest git commit" do
it "should return the most recent SHA" do
- sha = LatestCommit.new.id
+ latest_commit = double("LatestCommit")
+ latest_commit.stub(:id).and_return fake_sha
+ sha = latest_commit.id
sha.length.should be 40
end
end
+
+def fake_sha
+ 'c5b5861cb13fc2f2fcbe0d3578758def652c08ab'
+end
Please sign in to comment.
Something went wrong with that request. Please try again.