package com.github.dispader.manifesto

import org.ajoberstar.grgit.Grgit
import org.eclipse.jgit.errors.RepositoryNotFoundException

import spock.lang.Ignore
import spock.lang.Specification

public class RepositorySpecification extends Specification {

    def repository = new Repository('.')

    @Ignore
    def 'can determine the remote for a repository'() {
        expect:
            repository.url == 'git@github.com:Dispader/manifesto.git'
    }

    def 'can describe a repository'() {
        expect:
            repository.describe ==~ /v?\d+\.\d+\.\d(-.*)?/
    }

    def 'can report that a repository has commits'() {
        expect:
            repository.has_commits == true
    }

    def 'can report that a repository has tags'() {
        expect:
            repository.has_tags == true
    }

}

package com.github.dispader.manifesto

import org.ajoberstar.grgit.Grgit
import org.eclipse.jgit.errors.RepositoryNotFoundException

import spock.lang.Ignore
import spock.lang.Specification

public class RepositorySpecification extends Specification {

    def repository = new Repository('.')

    @Ignore
    def 'can determine the remote for a repository'() {
        expect:
            repository.url == 'git@github.com:Dispader/manifesto.git'
    }

    def 'can describe a repository'() {
        expect:
            repository.describe ==~ /v?\d+\.\d+\.\d+(-\d+)?(-.*)?/
    }

    def 'can report that a repository has commits'() {
        expect:
            repository.has_commits == true
    }

    def 'can report that a repository has tags'() {
        expect:
            repository.has_tags == true
    }

}

Fix regex for testing valid returns from describe
Fix regex for testing valid returns from describe

I'm not sure if we want all elements of a describe proper (the
equivalent to 'git describe' or 'git describe --tags') to be valid
for version numbers we'll accept, but this test is concerned with
getting a valid output from describe.

The new regex more accurately tests all possible describe results.
