<commit_before>package com.github.dispader.manifesto

import spock.lang.*
import org.gradle.api.*
import org.gradle.testfixtures.*

class ManifestoPluginSpec extends Specification {

    private Project project = ProjectBuilder.builder().build()

    def '(plugins: java) JAr manifest contains a version'() {
        given:
            project.pluginManager.apply 'java'
        expect:
            project.tasks.jar.manifest.attributes['Manifest-Version'] == '1.0'
    }

    def '(plugins: manifesto, java) adds manifest attributes to the JAr'() {
        given:
            project.pluginManager.apply 'com.github.dispader.manifesto'
            project.pluginManager.apply 'java'
            def attributes = project.tasks.jar.manifest.attributes
        expect:
            attributes[attribute] ==~ pattern
        where:
            attribute                  | pattern
            'Manifest-Version'         | '1.0'
            'Specification-Title'      | 'test'
            'Specification-Version'    | /\d+\.\d+\.\d/
            'Implementation-Title'     | 'test'
            'Implementation-Version'   | /\d+\.\d+\.\d(-.*)?/
            'Implementation-Timestamp' | /.+/
    }

    def '(plugins: java, manifesto) adds manifest attributes to the JAr'() {
        given:
            project.pluginManager.apply 'java'
            project.pluginManager.apply 'com.github.dispader.manifesto'
            def attributes = project.tasks.jar.manifest.attributes
        expect:
            attributes[attribute] ==~ pattern
        where:
            attribute                  | pattern
            'Manifest-Version'         | '1.0'
            'Specification-Title'      | 'test'
            'Specification-Version'    | /\d+\.\d+\.\d/
            'Implementation-Title'     | 'test'
            'Implementation-Version'   | /\d+\.\d+\.\d(-.*)?/
            'Implementation-Timestamp' | /.+/
    }

    def '(plugins: war, manifesto) adds manifest attributes to the WAr'() {
        given:
            project.pluginManager.apply 'war'
            project.pluginManager.apply 'com.github.dispader.manifesto'
            def attributes = project.tasks.jar.manifest.attributes
        expect:
            attributes[attribute] ==~ pattern
        where:
            attribute                  | pattern
            'Manifest-Version'         | '1.0'
            'Specification-Title'      | 'test'
            'Specification-Version'    | /\d+\.\d+\.\d/<commit_msg>Correct test method description<commit_after>package com.github.dispader.manifesto

import spock.lang.*
import org.gradle.api.*
import org.gradle.testfixtures.*

class ManifestoPluginSpec extends Specification {

    private Project project = ProjectBuilder.builder().build()

    def '(plugins: java) JAr manifest contains a version'() {
        given:
            project.pluginManager.apply 'java'
        expect:
            project.tasks.jar.manifest.attributes['Manifest-Version'] == '1.0'
    }

    def '(plugins: manifesto, java) adds manifest attributes to the JAr'() {
        given:
            project.pluginManager.apply 'com.github.dispader.manifesto'
            project.pluginManager.apply 'java'
            def attributes = project.tasks.jar.manifest.attributes
        expect:
            attributes[attribute] ==~ pattern
        where:
            attribute                  | pattern
            'Manifest-Version'         | '1.0'
            'Specification-Title'      | 'test'
            'Specification-Version'    | /\d+\.\d+\.\d/
            'Implementation-Title'     | 'test'
            'Implementation-Version'   | /\d+\.\d+\.\d(-.*)?/
            'Implementation-Timestamp' | /.+/
    }

    def '(plugins: java, manifesto) adds manifest attributes to the JAr'() {
        given:
            project.pluginManager.apply 'java'
            project.pluginManager.apply 'com.github.dispader.manifesto'
            def attributes = project.tasks.jar.manifest.attributes
        expect:
            attributes[attribute] ==~ pattern
        where:
            attribute                  | pattern
            'Manifest-Version'         | '1.0'
            'Specification-Title'      | 'test'
            'Specification-Version'    | /\d+\.\d+\.\d/
            'Implementation-Title'     | 'test'
            'Implementation-Version'   | /\d+\.\d+\.\d(-.*)?/
            'Implementation-Timestamp' | /.+/
    }

    def '(plugins: war, manifesto) adds manifest attributes to the JAr'() {
        given:
            project.pluginManager.apply 'war'
            project.pluginManager.apply 'com.github.dispader.manifesto'
            def attributes = project.tasks.jar.manifest.attributes
        expect:
            attributes[attribute] ==~ pattern
        where:
            attribute                  | pattern
            'Manifest-Version'         | '1.0'
            'Specification-Title'      | 'test'
            'Specification-Version'    | /\d+\.\d+\.\d/
{'fraction_non_alphanumeric': 0.12570507655116842, 'fraction_numerical': 0.0032232070910556, 'mean_word_length': 1.7101528384279476, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2498954', 'n_tokens_mistral': 1355, 'n_tokens_neox': 1311, 'n_words': 262}