{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/57060756","id":57060756,"diff_hunk":"@@ -0,0 +1,177 @@\n+require 'yaml'\n+require 'fileutils'\n+require 'pathname'\n+require 'vcr'\n+\n+GEMS_PENDING_ROOT ||= File.expand_path(File.join(__dir__, \"../..\"))\n+\n+class TestEnvHelper\n+  attr_reader :relative_dir, :absolute_recording_dir, :config_file\n+\n+  SPEC_DIR       = File.join(GEMS_PENDING_ROOT, 'spec')\n+  SPEC_PATH      = Pathname.new(SPEC_DIR)\n+  RECORDINGS_DIR = File.join(SPEC_DIR, 'recordings')\n+\n+  # Set TEST_ENV_DIR environment variable, when recording.\n+  TEST_ENV_DIR       = ENV['TEST_ENV_DIR'] || File.join(SPEC_DIR, 'test_env')\n+  CONFIG_DIR         = File.join(TEST_ENV_DIR, 'config')\n+  GLOBAL_CONFIG_FILE = File.join(TEST_ENV_DIR, 'config.yml')\n+\n+  def initialize(test_path)\n+    # <GEMS_PENDING_ROOT>/spec/some_dir1/some_dir2/some_spec.rb\n+    @test_file     = File.expand_path(test_path)\n+\n+    # <GEMS_PENDING_ROOT>/spec/some_dir1/some_dir2\n+    @test_dir      = File.dirname(@test_file)\n+\n+    # some_spec\n+    @test_basename = File.basename(@test_file, \".rb\")\n+\n+    # some_dir1/some_dir2/some_spec\n+    @relative_dir = File.join(spec_relative_path(@test_dir), @test_basename)\n+\n+    # <GEMS_PENDING_ROOT>/spec/recordings/some_dir1/some_dir2\n+    @absolute_recording_dir = File.join(RECORDINGS_DIR, @relative_dir)\n+\n+    # <GEMS_PENDING_ROOT>/spec/test_env/config/some_dir1/some_dir2/some_spec.yml\n+    @config_file = File.join(CONFIG_DIR, \"#{@relative_dir}.yml\")\n+  end\n+\n+  # Global configuration values.\n+  def self.[](tag)\n+    global_config_values[tag] || global_config_filter[tag] || global_config_default[tag]\n+  end\n+\n+  # Test-local configuration values - can override global.\n+  def [](tag)\n+    config_values[tag] || config_filter[tag] || config_default[tag] || self.class[tag]\n+  end\n+\n+  #\n+  # Global configuration.\n+  #\n+  def self.global_config\n+    @global_config ||= begin\n+      YAML.load_file(GLOBAL_CONFIG_FILE)\n+    rescue\n+      {}\n+    end\n+  end\n+\n+  def global_config\n+    self.class.global_config\n+  end\n+\n+  def self.global_config_values\n+    @global_config_values ||= global_config[:values] || {}\n+  end\n+\n+  def global_config_values\n+    self.class.global_config_values\n+  end\n+\n+  def self.global_config_filter\n+    @global_config_filter ||= global_config[:filter] || {}\n+  end\n+\n+  def global_config_filter\n+    self.class.global_config_filter\n+  end\n+\n+  def self.global_config_default\n+    @global_config_default ||= global_config[:default] || {}\n+  end\n+\n+  def global_config_default\n+    @self.class.global_config_default\n+  end\n+\n+  #\n+  # Test-local configuration.\n+  #\n+  def config\n+    @config ||= begin\n+      YAML.load_file(@config_file)\n+    rescue => err\n+      puts err.to_s\n+      {}\n+    end\n+  end\n+\n+  def config_values\n+    @config_values ||= config[:values] || {}\n+  end\n+\n+  def config_filter\n+    @config_filter ||= config[:filter] || {}\n+  end\n+\n+  def config_default\n+    @config_default ||= config[:default] || {}\n+  end\n+\n+  #\n+  # Path and directory methods.\n+  #\n+  def cassette_for(id)\n+    File.join(@relative_dir, \"#{@test_basename}#{id}\")\n+  end\n+\n+  def spec_relative_path(path)\n+    Pathname.new(File.expand_path(path)).relative_path_from(SPEC_PATH).to_s\n+  end\n+\n+  def pwd_relative_path(path)\n+    self.class.pwd_relative_path(path)\n+  end\n+\n+  def self.recordings_dir\n+    pwd_relative_path(RECORDINGS_DIR)\n+  end\n+\n+  def self.pwd_relative_path(path)\n+    pwd = Pathname.new(Dir.getwd)\n+    Pathname.new(File.expand_path(path)).relative_path_from(pwd).to_s\n+  end\n+\n+  def ensure_recording_dir_exists\n+    FileUtils.mkdir_p(@absolute_recording_dir)\n+  end","path":"gems/pending/spec/support/test_env_helper.rb","position":139,"original_position":139,"commit_id":"bc9414bc7912a2844e211bdeb7dbdf35cff894a7","original_commit_id":"2c21e9ef8d823ef0775f65ff7209b08d58a4f765","user":{"login":"roliveri","id":2810177,"avatar_url":"https://avatars.githubusercontent.com/u/2810177?v=3","gravatar_id":"","url":"https://api.github.com/users/roliveri","html_url":"https://github.com/roliveri","followers_url":"https://api.github.com/users/roliveri/followers","following_url":"https://api.github.com/users/roliveri/following{/other_user}","gists_url":"https://api.github.com/users/roliveri/gists{/gist_id}","starred_url":"https://api.github.com/users/roliveri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roliveri/subscriptions","organizations_url":"https://api.github.com/users/roliveri/orgs","repos_url":"https://api.github.com/users/roliveri/repos","events_url":"https://api.github.com/users/roliveri/events{/privacy}","received_events_url":"https://api.github.com/users/roliveri/received_events","type":"User","site_admin":false},"body":"Hmmm, I missed that one. Yes, it should be moved. Thanks.","created_at":"2016-03-22T20:15:27Z","updated_at":"2016-03-22T20:15:27Z","html_url":"https://github.com/ManageIQ/manageiq/pull/7341#discussion_r57060756","pull_request_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/7341","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/57060756"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/7341#discussion_r57060756"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/7341"}}},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/7341","id":63154658,"html_url":"https://github.com/ManageIQ/manageiq/pull/7341","diff_url":"https://github.com/ManageIQ/manageiq/pull/7341.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/7341.patch","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/7341","number":7341,"state":"open","locked":false,"title":"Added the AzureBlobDisk module for MiqDisk.","user":{"login":"roliveri","id":2810177,"avatar_url":"https://avatars.githubusercontent.com/u/2810177?v=3","gravatar_id":"","url":"https://api.github.com/users/roliveri","html_url":"https://github.com/roliveri","followers_url":"https://api.github.com/users/roliveri/followers","following_url":"https://api.github.com/users/roliveri/following{/other_user}","gists_url":"https://api.github.com/users/roliveri/gists{/gist_id}","starred_url":"https://api.github.com/users/roliveri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roliveri/subscriptions","organizations_url":"https://api.github.com/users/roliveri/orgs","repos_url":"https://api.github.com/users/roliveri/repos","events_url":"https://api.github.com/users/roliveri/events{/privacy}","received_events_url":"https://api.github.com/users/roliveri/received_events","type":"User","site_admin":false},"body":"Added the AzureBlobDisk module for MiqDisk, to support SSA for Azure.","created_at":"2016-03-16T23:55:14Z","updated_at":"2016-03-22T20:15:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e410617085d3472ce0781d80eb40b5eecaeefbc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/7341/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/7341/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/7341/comments","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/bc9414bc7912a2844e211bdeb7dbdf35cff894a7","head":{"label":"roliveri:azure_ssa","ref":"azure_ssa","sha":"bc9414bc7912a2844e211bdeb7dbdf35cff894a7","user":{"login":"roliveri","id":2810177,"avatar_url":"https://avatars.githubusercontent.com/u/2810177?v=3","gravatar_id":"","url":"https://api.github.com/users/roliveri","html_url":"https://github.com/roliveri","followers_url":"https://api.github.com/users/roliveri/followers","following_url":"https://api.github.com/users/roliveri/following{/other_user}","gists_url":"https://api.github.com/users/roliveri/gists{/gist_id}","starred_url":"https://api.github.com/users/roliveri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roliveri/subscriptions","organizations_url":"https://api.github.com/users/roliveri/orgs","repos_url":"https://api.github.com/users/roliveri/repos","events_url":"https://api.github.com/users/roliveri/events{/privacy}","received_events_url":"https://api.github.com/users/roliveri/received_events","type":"User","site_admin":false},"repo":{"id":20816264,"name":"manageiq","full_name":"roliveri/manageiq","owner":{"login":"roliveri","id":2810177,"avatar_url":"https://avatars.githubusercontent.com/u/2810177?v=3","gravatar_id":"","url":"https://api.github.com/users/roliveri","html_url":"https://github.com/roliveri","followers_url":"https://api.github.com/users/roliveri/followers","following_url":"https://api.github.com/users/roliveri/following{/other_user}","gists_url":"https://api.github.com/users/roliveri/gists{/gist_id}","starred_url":"https://api.github.com/users/roliveri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roliveri/subscriptions","organizations_url":"https://api.github.com/users/roliveri/orgs","repos_url":"https://api.github.com/users/roliveri/repos","events_url":"https://api.github.com/users/roliveri/events{/privacy}","received_events_url":"https://api.github.com/users/roliveri/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/roliveri/manageiq","description":"ManageIQ Cloud Management Platform","fork":true,"url":"https://api.github.com/repos/roliveri/manageiq","forks_url":"https://api.github.com/repos/roliveri/manageiq/forks","keys_url":"https://api.github.com/repos/roliveri/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/roliveri/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/roliveri/manageiq/teams","hooks_url":"https://api.github.com/repos/roliveri/manageiq/hooks","issue_events_url":"https://api.github.com/repos/roliveri/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/roliveri/manageiq/events","assignees_url":"https://api.github.com/repos/roliveri/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/roliveri/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/roliveri/manageiq/tags","blobs_url":"https://api.github.com/repos/roliveri/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/roliveri/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/roliveri/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/roliveri/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/roliveri/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/roliveri/manageiq/languages","stargazers_url":"https://api.github.com/repos/roliveri/manageiq/stargazers","contributors_url":"https://api.github.com/repos/roliveri/manageiq/contributors","subscribers_url":"https://api.github.com/repos/roliveri/manageiq/subscribers","subscription_url":"https://api.github.com/repos/roliveri/manageiq/subscription","commits_url":"https://api.github.com/repos/roliveri/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/roliveri/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/roliveri/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/roliveri/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/roliveri/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/roliveri/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/roliveri/manageiq/merges","archive_url":"https://api.github.com/repos/roliveri/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/roliveri/manageiq/downloads","issues_url":"https://api.github.com/repos/roliveri/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/roliveri/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/roliveri/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/roliveri/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/roliveri/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/roliveri/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/roliveri/manageiq/deployments","created_at":"2014-06-13T20:03:38Z","updated_at":"2014-06-19T17:26:25Z","pushed_at":"2016-03-21T17:54:02Z","git_url":"git://github.com/roliveri/manageiq.git","ssh_url":"git@github.com:roliveri/manageiq.git","clone_url":"https://github.com/roliveri/manageiq.git","svn_url":"https://github.com/roliveri/manageiq","homepage":null,"size":110110,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"ManageIQ:master","ref":"master","sha":"5f54588db62975032981f4cb622bb5ccd3734481","user":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"repo":{"id":20789757,"name":"manageiq","full_name":"ManageIQ/manageiq","owner":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ManageIQ/manageiq","description":"ManageIQ Cloud Management Platform","fork":false,"url":"https://api.github.com/repos/ManageIQ/manageiq","forks_url":"https://api.github.com/repos/ManageIQ/manageiq/forks","keys_url":"https://api.github.com/repos/ManageIQ/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ManageIQ/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ManageIQ/manageiq/teams","hooks_url":"https://api.github.com/repos/ManageIQ/manageiq/hooks","issue_events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/ManageIQ/manageiq/events","assignees_url":"https://api.github.com/repos/ManageIQ/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/ManageIQ/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/ManageIQ/manageiq/tags","blobs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ManageIQ/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/ManageIQ/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/ManageIQ/manageiq/languages","stargazers_url":"https://api.github.com/repos/ManageIQ/manageiq/stargazers","contributors_url":"https://api.github.com/repos/ManageIQ/manageiq/contributors","subscribers_url":"https://api.github.com/repos/ManageIQ/manageiq/subscribers","subscription_url":"https://api.github.com/repos/ManageIQ/manageiq/subscription","commits_url":"https://api.github.com/repos/ManageIQ/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/ManageIQ/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/ManageIQ/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/ManageIQ/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ManageIQ/manageiq/merges","archive_url":"https://api.github.com/repos/ManageIQ/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ManageIQ/manageiq/downloads","issues_url":"https://api.github.com/repos/ManageIQ/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/ManageIQ/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/ManageIQ/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/ManageIQ/manageiq/releases{/id}","deployments_url":"https://api.github.com/repos/ManageIQ/manageiq/deployments","created_at":"2014-06-13T02:31:26Z","updated_at":"2016-03-19T13:38:08Z","pushed_at":"2016-03-22T20:10:02Z","git_url":"git://github.com/ManageIQ/manageiq.git","ssh_url":"git@github.com:ManageIQ/manageiq.git","clone_url":"https://github.com/ManageIQ/manageiq.git","svn_url":"https://github.com/ManageIQ/manageiq","homepage":"manageiq.org","size":148481,"stargazers_count":239,"watchers_count":239,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":262,"mirror_url":null,"open_issues_count":631,"forks":262,"open_issues":631,"watchers":239,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/7341"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/7341"},"issue":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/7341"},"comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/7341/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/7341/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/7341/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/manageiq/statuses/bc9414bc7912a2844e211bdeb7dbdf35cff894a7"}}}}