<commit_before>(ns puppetlabs.puppetserver.cli.gem-test
  (:require [clojure.test :refer :all]
            [puppetlabs.puppetserver.cli.gem :refer :all]))

(deftest cli-gem-environment-test
  (let [fake-config {:jruby-puppet {:gem-home "/fake/path"}}
        fake-env {"PATH" "/bin:/usr/bin", "FOO_DEBUG" "1"}]
    (testing "The environment intended for the gem subcommand"
      (is (not (empty? ((cli-gem-environment fake-config fake-env) "PATH")))
          "has a non-empty PATH originating from the System")
      (is (= "/bin:/usr/bin" ((cli-gem-environment fake-config fake-env)
                               "PATH"))
          "does not modify the PATH environment variable")
      (is (= "/fake/path" ((cli-gem-environment fake-config fake-env)
                            "GEM_HOME"))
          "has GEM_HOME set to /fake/path from the provided config")
      (is (= "1" ((cli-gem-environment fake-config fake-env)
                      "FOO_DEBUG"))
          "preserves arbitrary environment vars for the end user"))))
<commit_msg>Revert "(SERVER-262) Remove JARS_NO_REQUIRE failing test"<commit_after>(ns puppetlabs.puppetserver.cli.gem-test
  (:require [clojure.test :refer :all]
            [puppetlabs.puppetserver.cli.gem :refer :all]))

(deftest cli-gem-environment-test
  (let [fake-config {:jruby-puppet {:gem-home "/fake/path"}}
        fake-env {"PATH" "/bin:/usr/bin", "FOO_DEBUG" "1"}]
    (testing "The environment intended for the gem subcommand"
      (is (not (empty? ((cli-gem-environment fake-config fake-env) "PATH")))
          "has a non-empty PATH originating from the System")
      (is (= "/bin:/usr/bin" ((cli-gem-environment fake-config fake-env)
                               "PATH"))
          "does not modify the PATH environment variable")
      (is (= "/fake/path" ((cli-gem-environment fake-config fake-env)
                            "GEM_HOME"))
          "has GEM_HOME set to /fake/path from the provided config")
      (is (= "true" ((cli-gem-environment fake-config fake-env)
                      "JARS_NO_REQUIRE"))
          "has JARS_NO_REQUIRE set to true")
      (is (= "1" ((cli-gem-environment fake-config fake-env)
                      "FOO_DEBUG"))
          "preserves arbitrary environment vars for the end user"))))

{'fraction_non_alphanumeric': 0.1427945685501533, 'fraction_numerical': 0.0030661410424879547, 'mean_word_length': 2.383703703703704, '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': '2974623', 'n_tokens_mistral': 731, 'n_tokens_neox': 702, 'n_words': 188}