|
34 | 34 | end
|
35 | 35 | end
|
36 | 36 | end
|
| 37 | + |
| 38 | + describe "Commit info" do |
| 39 | + before do |
| 40 | + @committer = double( |
| 41 | + |
| 42 | + name: 'Mike Smith' |
| 43 | + ) |
| 44 | + |
| 45 | + @author = double( |
| 46 | + |
| 47 | + name: 'John Smith' |
| 48 | + ) |
| 49 | + |
| 50 | + @raw_commit = double( |
| 51 | + id: "bcf03b5de6abcf03b5de6c", |
| 52 | + author: @author, |
| 53 | + committer: @committer, |
| 54 | + committed_date: Date.yesterday, |
| 55 | + message: 'Refactoring specs' |
| 56 | + ) |
| 57 | + |
| 58 | + @commit = Commit.new(@raw_commit) |
| 59 | + end |
| 60 | + |
| 61 | + it { @commit.short_id.should == "bcf03b5de6a" } |
| 62 | + it { @commit.safe_message.should == @raw_commit.message } |
| 63 | + it { @commit.created_at.should == @raw_commit.committed_date } |
| 64 | + it { @commit.author_email.should == @author.email } |
| 65 | + it { @commit.author_name.should == @author.name } |
| 66 | + it { @commit.committer_name.should == @committer.name } |
| 67 | + it { @commit.committer_email.should == @committer.email } |
| 68 | + it { @commit.different_committer?.should be_true } |
| 69 | + end |
| 70 | + |
| 71 | + describe "Class methods" do |
| 72 | + subject { Commit } |
| 73 | + |
| 74 | + it { should respond_to(:find_or_first) } |
| 75 | + it { should respond_to(:fresh_commits) } |
| 76 | + it { should respond_to(:commits_with_refs) } |
| 77 | + it { should respond_to(:commits_since) } |
| 78 | + it { should respond_to(:commits_between) } |
| 79 | + it { should respond_to(:commits) } |
| 80 | + it { should respond_to(:compare) } |
| 81 | + end |
| 82 | + |
| 83 | + describe "delegation" do |
| 84 | + subject { commit } |
| 85 | + |
| 86 | + it { should respond_to(:message) } |
| 87 | + it { should respond_to(:authored_date) } |
| 88 | + it { should respond_to(:committed_date) } |
| 89 | + it { should respond_to(:parents) } |
| 90 | + it { should respond_to(:date) } |
| 91 | + it { should respond_to(:committer) } |
| 92 | + it { should respond_to(:author) } |
| 93 | + it { should respond_to(:diffs) } |
| 94 | + it { should respond_to(:tree) } |
| 95 | + it { should respond_to(:id) } |
| 96 | + it { should respond_to(:to_patch) } |
| 97 | + end |
37 | 98 | end
|
0 commit comments