<commit_before>package gvm

import spock.lang.Specification

import static gvm.TestUtils.prepareBaseDir

class BootstrapSpec extends Specification {

    CurlStub curlStub
    BashEnv bash

    File gvmBaseDir
    String gvmBaseEnv
    String bootstrap

    void setup(){
        gvmBaseDir = prepareBaseDir()
        gvmBaseEnv = gvmBaseDir.absolutePath
        bootstrap = "${gvmBaseDir.absolutePath}/.gvm/bin/gvm-init.sh"


        curlStub = CurlStub.prepareIn(new File(gvmBaseDir, "bin"))
    }

    void "should set gvm version"(){
        given: 'a working gvm installation with default curl stub'
        bash = GvmBashEnvBuilder.create(gvmBaseDir).build()
        bash.start()
        bash.execute("source $bootstrap")

        when: 'I request the gvm version'
        bash.execute("gvm version")

        then: 'the gvm version is displayed'
        bash.output.contains "x.y.z"
    }

    void "should suggest selfupdate on new version available if no suggestive selfupdate configuration found"() {

        given: 'a working installation with a curl stub primed for version update'
        curlStub.primeWith("http://localhost:8080/app/version", "echo x.y.b").build()<commit_msg>Remove redundant test from bootstrap spec.<commit_after>package gvm

import spock.lang.Specification

import static gvm.TestUtils.prepareBaseDir

class BootstrapSpec extends Specification {

    CurlStub curlStub
    BashEnv bash

    File gvmBaseDir
    String gvmBaseEnv
    String bootstrap

    void setup(){
        gvmBaseDir = prepareBaseDir()
        gvmBaseEnv = gvmBaseDir.absolutePath
        bootstrap = "${gvmBaseDir.absolutePath}/.gvm/bin/gvm-init.sh"


        curlStub = CurlStub.prepareIn(new File(gvmBaseDir, "bin"))
    }

    void "should suggest selfupdate on new version available if no suggestive selfupdate configuration found"() {

        given: 'a working installation with a curl stub primed for version update'
        curlStub.primeWith("http://localhost:8080/app/version", "echo x.y.b").build()
{'fraction_non_alphanumeric': 0.08676251859196826, 'fraction_numerical': 0.0039662865642042635, 'mean_word_length': 3.152263374485597, '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': '7307693', 'n_tokens_mistral': 608, 'n_tokens_neox': 576, 'n_words': 163}