git-timecost/spec/commit_spec.cr

33 lines
618 B
Crystal
Raw Permalink Normal View History

2023-07-11 16:52:48 +00:00
require "./spec_helper"
require "../src/timecost/author"
require "../src/timecost/commit"
describe TimeCost::Commit do
describe ".new" do
it "can be created from string" do
author = TimeCost::Author.new(
name: "Jon Snow",
email: "jon.snow@example.com"
)
commit = TimeCost::Commit.new(
2023-07-12 09:27:21 +00:00
commit_hash: Random::Secure.base64(40),
2023-07-11 16:52:48 +00:00
datetime: Time.utc,
author: author,
2023-07-12 09:27:21 +00:00
message: "First commit"
2023-07-11 16:52:48 +00:00
)
commit.should be_a(TimeCost::Commit)
end
end
describe ".date" do
end
describe ".author" do
end
describe ".note" do
end
end