spec/git_spec.rb in heroku_san-2.0.0 vs spec/git_spec.rb in heroku_san-2.1.0

- old
+ new

@@ -50,6 +50,25 @@ it "returns nil for a blank tag" do subject.should_not_receive("`").with("git rev-parse ") { "\n" } subject.git_rev_parse(nil).should == nil end end + + describe "#git_revision" do + it "returns the current revision of the repository (on Heroku)" do + subject.should_receive("`").with("git ls-remote --heads staging master") { "sha\n" } + subject.git_revision('staging').should == 'sha' + end + + it "returns nil if there is no revision (i.e. not deployed yet)" do + subject.should_receive("`").with("git ls-remote --heads staging master") { "\n" } + subject.git_revision('staging').should == nil + end + end + + describe "#git_named_rev" do + it "returns symbolic names for given rev" do + subject.should_receive("`").with("git name-rev sha") {"sha production/123456\n"} + subject.git_named_rev('sha').should == 'sha production/123456' + end + end end \ No newline at end of file