               (testing "all environments"
                 (is (= expected-envs-info (get-class-info))))
               (testing "one environment by name"
+                (is (nil? (get-class-info-for-env "env1"))
+                    "Unexpected info retrieved for 'env1'")
                 (is (= (expected-envs-info "env2")
                        (get-class-info-for-env "env2"))
                     "Unexpected info retrieved for 'env2'")

          jruby-puppet (:jruby-puppet instance)
          container (:scripting-container instance)

          env-dir (fn [env-name]
                    (fs/file code-dir "environments" env-name))
          create-file (fn [file content]
                        (ks/mkdirs! (fs/parent file))
                        (spit file content))
          gen-classes (fn [[mod-dir manifests]]
                        (let [manifest-dir (fs/file mod-dir "manifests")]
                          (ks/mkdirs! manifest-dir)
                          (doseq [manifest manifests]
                            (spit (fs/file manifest-dir (str manifest ".pp"))
                                  (str
                                    "class " manifest "($" manifest "_a, Integer $"
                                    manifest "_b, String $" manifest
                                    "_c = 'c default value') { }\n"
                                    "class " manifest "2($" manifest "2_a, Integer $"
                                    manifest "2_b, String $" manifest
                                    "2_c = 'c default value') { }\n")))))
          create-env-conf (fn [env-dir content]
                            (create-file (fs/file env-dir "environment.conf")
                                         (str "environment_timeout = unlimited\n"
                                              content)))
          create-env (fn [[env-dir manifests]]
                       (create-env-conf env-dir "")
                       (gen-classes [env-dir manifests]))

          _ (create-file (fs/file conf-dir "puppet.conf")
                         "[main]\nenvironment_timeout=unlimited\nbasemodulepath=$codedir/modules\n")

          env-1-dir (env-dir "env1")
          env-1-dir-and-manifests [env-1-dir ["foo" "bar"]]
          _ (create-env env-1-dir-and-manifests)

          _ (gen-classes [bogus-env-dir ["envbogus"]])
          _ (gen-classes [(fs/file base-mod-dir "base-bogus") ["base-bogus1"]])

          get-class-info (fn []
            (-> (.getClassInfoForAllEnvironments jruby-puppet)
                (roundtrip-via-json)))
          get-class-info-for-env (fn [env]
                                   (-> (.getClassInfoForEnvironment jruby-puppet
                                                                    env)
