1
0
mirror of https://github.com/danog/gift.git synced 2024-11-30 04:19:37 +01:00
gift/test/tag.test.coffee

45 lines
1.1 KiB
CoffeeScript
Raw Normal View History

2012-02-15 15:51:45 +01:00
should = require 'should'
fixtures = require './fixtures'
git = require '../src'
Tag = require '../src/tag'
describe "Tag", ->
describe ".find_all", ->
repo = fixtures.tagged
tags = null
before (done) ->
Tag.find_all repo, (err, _tags) ->
tags = _tags
done err
2014-06-19 21:53:13 +02:00
2012-02-15 15:51:45 +01:00
it "is an Array of Tags", ->
tags.should.be.an.instanceof Array
tags[0].should.be.an.instanceof Tag
2014-06-19 21:53:13 +02:00
2012-02-15 15:51:45 +01:00
pref = "the tag"
it "#{pref} has the correct name", ->
tags[0].name.should.eql "tag-1"
2014-06-19 21:53:13 +02:00
2012-02-15 15:51:45 +01:00
it "#{pref} has the correct commit", ->
tags[0].commit.id.should.eql "32bbb351de16c3e404b3b7c77601c3d124e1e1a1"
2014-06-19 21:53:13 +02:00
2012-02-15 15:51:45 +01:00
describe "#message", ->
repo = fixtures.tagged
tags = null
message = null
before (done) ->
repo.tags (err, _tags) ->
tags = _tags
done err if err
tags[0].message (err, _message) ->
message = _message
done err
2014-06-19 21:53:13 +02:00
2012-02-15 15:51:45 +01:00
it "is the correct message", ->
2014-06-19 21:53:13 +02:00
message.should.containEql "the first tag"
2012-02-15 15:51:45 +01:00
it "has the correct commit", ->
tags[0].commit.message.should.eql "commit 5"