{"action":"created","comment":{"url":"https://api.github.com/repos/cloudfoundry/java-buildpack/pulls/comments/27110533","id":27110533,"diff_hunk":"@@ -0,0 +1,53 @@\n+# Encoding: utf-8\n+# Cloud Foundry Java Buildpack\n+# Copyright 2013-2015 the original author or authors.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#      http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+require 'java_buildpack/util'\n+require 'java_buildpack/util/configuration_utils'\n+require 'logging_helper'\n+require 'pathname'\n+require 'spec_helper'\n+require 'yaml'\n+\n+describe JavaBuildpack::Util::ConfigurationUtils do\n+  include_context 'logging_helper'\n+\n+  it 'not load absent configuration file' do\n+    allow_any_instance_of(Pathname).to receive(:exist?).and_return(false)\n+    expect(described_class.load('test')).to eq({})\n+  end\n+\n+  context do\n+\n+    before do\n+      allow_any_instance_of(Pathname).to receive(:exist?).and_return(true)\n+      allow(YAML).to receive(:load_file).and_return('foo' => { 'one' => '1', 'two' => 2 },\n+                                                    'bar' => { 'alpha' => { 'one' => 'cat', 'two' => 'dog' } })\n+    end\n+\n+    it 'load configuration file' do\n+      expect(described_class.load('test')).to eq('foo' => { 'one' => '1', 'two' => 2 },\n+                                                 'bar' => { 'alpha' => { 'one' => 'cat', 'two' => 'dog' } })\n+    end\n+\n+    it 'overlays matching environment variables' do","path":"spec/java_buildpack/util/configuration_utils_spec.rb","position":45,"original_position":45,"commit_id":"2f586e181d308be68c9e57168895bf62a662b53f","original_commit_id":"2f586e181d308be68c9e57168895bf62a662b53f","user":{"login":"nebhale","id":60754,"avatar_url":"https://avatars.githubusercontent.com/u/60754?v=3","gravatar_id":"","url":"https://api.github.com/users/nebhale","html_url":"https://github.com/nebhale","followers_url":"https://api.github.com/users/nebhale/followers","following_url":"https://api.github.com/users/nebhale/following{/other_user}","gists_url":"https://api.github.com/users/nebhale/gists{/gist_id}","starred_url":"https://api.github.com/users/nebhale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nebhale/subscriptions","organizations_url":"https://api.github.com/users/nebhale/orgs","repos_url":"https://api.github.com/users/nebhale/repos","events_url":"https://api.github.com/users/nebhale/events{/privacy}","received_events_url":"https://api.github.com/users/nebhale/received_events","type":"User","site_admin":false},"body":"This pollutes the environment for all subsequent tests.  You need to use the `:environment` support found [here](https://github.com/cloudfoundry/java-buildpack/blob/master/spec/application_helper.rb#L28-L39) ([example](https://github.com/cloudfoundry/java-buildpack/blob/master/spec/java_buildpack/framework/java_opts_spec.rb#L34)).","created_at":"2015-03-25T10:56:20Z","updated_at":"2015-03-25T10:56:20Z","html_url":"https://github.com/cloudfoundry/java-buildpack/pull/168#discussion_r27110533","pull_request_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/pulls/168","_links":{"self":{"href":"https://api.github.com/repos/cloudfoundry/java-buildpack/pulls/comments/27110533"},"html":{"href":"https://github.com/cloudfoundry/java-buildpack/pull/168#discussion_r27110533"},"pull_request":{"href":"https://api.github.com/repos/cloudfoundry/java-buildpack/pulls/168"}}},"pull_request":{"url":"https://api.github.com/repos/cloudfoundry/java-buildpack/pulls/168","id":31838208,"html_url":"https://github.com/cloudfoundry/java-buildpack/pull/168","diff_url":"https://github.com/cloudfoundry/java-buildpack/pull/168.diff","patch_url":"https://github.com/cloudfoundry/java-buildpack/pull/168.patch","issue_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/issues/168","number":168,"state":"open","locked":false,"title":"User configuration via variables","user":{"login":"cgfrost","id":166104,"avatar_url":"https://avatars.githubusercontent.com/u/166104?v=3","gravatar_id":"","url":"https://api.github.com/users/cgfrost","html_url":"https://github.com/cgfrost","followers_url":"https://api.github.com/users/cgfrost/followers","following_url":"https://api.github.com/users/cgfrost/following{/other_user}","gists_url":"https://api.github.com/users/cgfrost/gists{/gist_id}","starred_url":"https://api.github.com/users/cgfrost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgfrost/subscriptions","organizations_url":"https://api.github.com/users/cgfrost/orgs","repos_url":"https://api.github.com/users/cgfrost/repos","events_url":"https://api.github.com/users/cgfrost/events{/privacy}","received_events_url":"https://api.github.com/users/cgfrost/received_events","type":"User","site_admin":false},"body":"This commit adds support for overriding buildpack configuration with\r\nenvironment variables. The way Java config is processed has been\r\nmodified to allow this new support to work when configuring the\r\nrequired version of Java. Includes new tests and documentation, see\r\nthe main README.md for more details.\r\n\r\n[#86997400]","created_at":"2015-03-24T15:36:15Z","updated_at":"2015-03-25T10:56:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"504b17202ab1b97300486fd8e338708786e284c1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/pulls/168/commits","review_comments_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/pulls/168/comments","review_comment_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/issues/168/comments","statuses_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/statuses/2f586e181d308be68c9e57168895bf62a662b53f","head":{"label":"cgfrost:86997400-user-provided-config","ref":"86997400-user-provided-config","sha":"2f586e181d308be68c9e57168895bf62a662b53f","user":{"login":"cgfrost","id":166104,"avatar_url":"https://avatars.githubusercontent.com/u/166104?v=3","gravatar_id":"","url":"https://api.github.com/users/cgfrost","html_url":"https://github.com/cgfrost","followers_url":"https://api.github.com/users/cgfrost/followers","following_url":"https://api.github.com/users/cgfrost/following{/other_user}","gists_url":"https://api.github.com/users/cgfrost/gists{/gist_id}","starred_url":"https://api.github.com/users/cgfrost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgfrost/subscriptions","organizations_url":"https://api.github.com/users/cgfrost/orgs","repos_url":"https://api.github.com/users/cgfrost/repos","events_url":"https://api.github.com/users/cgfrost/events{/privacy}","received_events_url":"https://api.github.com/users/cgfrost/received_events","type":"User","site_admin":false},"repo":{"id":21042080,"name":"java-buildpack","full_name":"cgfrost/java-buildpack","owner":{"login":"cgfrost","id":166104,"avatar_url":"https://avatars.githubusercontent.com/u/166104?v=3","gravatar_id":"","url":"https://api.github.com/users/cgfrost","html_url":"https://github.com/cgfrost","followers_url":"https://api.github.com/users/cgfrost/followers","following_url":"https://api.github.com/users/cgfrost/following{/other_user}","gists_url":"https://api.github.com/users/cgfrost/gists{/gist_id}","starred_url":"https://api.github.com/users/cgfrost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgfrost/subscriptions","organizations_url":"https://api.github.com/users/cgfrost/orgs","repos_url":"https://api.github.com/users/cgfrost/repos","events_url":"https://api.github.com/users/cgfrost/events{/privacy}","received_events_url":"https://api.github.com/users/cgfrost/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cgfrost/java-buildpack","description":"Cloud Foundry buildpack for running Java applications","fork":true,"url":"https://api.github.com/repos/cgfrost/java-buildpack","forks_url":"https://api.github.com/repos/cgfrost/java-buildpack/forks","keys_url":"https://api.github.com/repos/cgfrost/java-buildpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cgfrost/java-buildpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cgfrost/java-buildpack/teams","hooks_url":"https://api.github.com/repos/cgfrost/java-buildpack/hooks","issue_events_url":"https://api.github.com/repos/cgfrost/java-buildpack/issues/events{/number}","events_url":"https://api.github.com/repos/cgfrost/java-buildpack/events","assignees_url":"https://api.github.com/repos/cgfrost/java-buildpack/assignees{/user}","branches_url":"https://api.github.com/repos/cgfrost/java-buildpack/branches{/branch}","tags_url":"https://api.github.com/repos/cgfrost/java-buildpack/tags","blobs_url":"https://api.github.com/repos/cgfrost/java-buildpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cgfrost/java-buildpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cgfrost/java-buildpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/cgfrost/java-buildpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cgfrost/java-buildpack/statuses/{sha}","languages_url":"https://api.github.com/repos/cgfrost/java-buildpack/languages","stargazers_url":"https://api.github.com/repos/cgfrost/java-buildpack/stargazers","contributors_url":"https://api.github.com/repos/cgfrost/java-buildpack/contributors","subscribers_url":"https://api.github.com/repos/cgfrost/java-buildpack/subscribers","subscription_url":"https://api.github.com/repos/cgfrost/java-buildpack/subscription","commits_url":"https://api.github.com/repos/cgfrost/java-buildpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/cgfrost/java-buildpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/cgfrost/java-buildpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/cgfrost/java-buildpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/cgfrost/java-buildpack/contents/{+path}","compare_url":"https://api.github.com/repos/cgfrost/java-buildpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cgfrost/java-buildpack/merges","archive_url":"https://api.github.com/repos/cgfrost/java-buildpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cgfrost/java-buildpack/downloads","issues_url":"https://api.github.com/repos/cgfrost/java-buildpack/issues{/number}","pulls_url":"https://api.github.com/repos/cgfrost/java-buildpack/pulls{/number}","milestones_url":"https://api.github.com/repos/cgfrost/java-buildpack/milestones{/number}","notifications_url":"https://api.github.com/repos/cgfrost/java-buildpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cgfrost/java-buildpack/labels{/name}","releases_url":"https://api.github.com/repos/cgfrost/java-buildpack/releases{/id}","created_at":"2014-06-20T15:11:44Z","updated_at":"2015-03-25T10:29:10Z","pushed_at":"2015-03-25T10:44:36Z","git_url":"git://github.com/cgfrost/java-buildpack.git","ssh_url":"git@github.com:cgfrost/java-buildpack.git","clone_url":"https://github.com/cgfrost/java-buildpack.git","svn_url":"https://github.com/cgfrost/java-buildpack","homepage":null,"size":3521,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cloudfoundry:master","ref":"master","sha":"7815fef836007dd9619d8d97cbf70886d761410d","user":{"login":"cloudfoundry","id":621746,"avatar_url":"https://avatars.githubusercontent.com/u/621746?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudfoundry","html_url":"https://github.com/cloudfoundry","followers_url":"https://api.github.com/users/cloudfoundry/followers","following_url":"https://api.github.com/users/cloudfoundry/following{/other_user}","gists_url":"https://api.github.com/users/cloudfoundry/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudfoundry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudfoundry/subscriptions","organizations_url":"https://api.github.com/users/cloudfoundry/orgs","repos_url":"https://api.github.com/users/cloudfoundry/repos","events_url":"https://api.github.com/users/cloudfoundry/events{/privacy}","received_events_url":"https://api.github.com/users/cloudfoundry/received_events","type":"Organization","site_admin":false},"repo":{"id":9899931,"name":"java-buildpack","full_name":"cloudfoundry/java-buildpack","owner":{"login":"cloudfoundry","id":621746,"avatar_url":"https://avatars.githubusercontent.com/u/621746?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudfoundry","html_url":"https://github.com/cloudfoundry","followers_url":"https://api.github.com/users/cloudfoundry/followers","following_url":"https://api.github.com/users/cloudfoundry/following{/other_user}","gists_url":"https://api.github.com/users/cloudfoundry/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudfoundry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudfoundry/subscriptions","organizations_url":"https://api.github.com/users/cloudfoundry/orgs","repos_url":"https://api.github.com/users/cloudfoundry/repos","events_url":"https://api.github.com/users/cloudfoundry/events{/privacy}","received_events_url":"https://api.github.com/users/cloudfoundry/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudfoundry/java-buildpack","description":"Cloud Foundry buildpack for running Java applications","fork":false,"url":"https://api.github.com/repos/cloudfoundry/java-buildpack","forks_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/forks","keys_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/teams","hooks_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/hooks","issue_events_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/issues/events{/number}","events_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/events","assignees_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/assignees{/user}","branches_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/branches{/branch}","tags_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/tags","blobs_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/languages","stargazers_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/stargazers","contributors_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/contributors","subscribers_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/subscribers","subscription_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/subscription","commits_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/contents/{+path}","compare_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/merges","archive_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/downloads","issues_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/issues{/number}","pulls_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/labels{/name}","releases_url":"https://api.github.com/repos/cloudfoundry/java-buildpack/releases{/id}","created_at":"2013-05-06T23:58:33Z","updated_at":"2015-03-25T10:24:59Z","pushed_at":"2015-03-25T10:44:37Z","git_url":"git://github.com/cloudfoundry/java-buildpack.git","ssh_url":"git@github.com:cloudfoundry/java-buildpack.git","clone_url":"https://github.com/cloudfoundry/java-buildpack.git","svn_url":"https://github.com/cloudfoundry/java-buildpack","homepage":null,"size":40791,"stargazers_count":65,"watchers_count":65,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":660,"mirror_url":null,"open_issues_count":15,"forks":660,"open_issues":15,"watchers":65,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudfoundry/java-buildpack/pulls/168"},"html":{"href":"https://github.com/cloudfoundry/java-buildpack/pull/168"},"issue":{"href":"https://api.github.com/repos/cloudfoundry/java-buildpack/issues/168"},"comments":{"href":"https://api.github.com/repos/cloudfoundry/java-buildpack/issues/168/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudfoundry/java-buildpack/pulls/168/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudfoundry/java-buildpack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudfoundry/java-buildpack/pulls/168/commits"},"statuses":{"href":"https://api.github.com/repos/cloudfoundry/java-buildpack/statuses/2f586e181d308be68c9e57168895bf62a662b53f"}}}}