Sha256: bcbdec91e76542215b7996ba8bd7032b5ca1b2b92d3a5f8a0597e5b90dd5c727

Contents?: true

Size: 589 Bytes

Versions: 3

Compression:

Stored size: 589 Bytes

Contents

module EnvPullRequest
  module TestHelper
    def stash_env_pull_request
      @original_travis_pull_request = ENV['TRAVIS_PULL_REQUEST']
      @original_circle_pr_number = ENV['CIRCLE_PR_NUMBER']
      @original_ghprb_pull_id = ENV['ghprbPullId']
      ENV.delete 'TRAVIS_PULL_REQUEST'
      ENV.delete 'CIRCLE_PR_NUMBER'
      ENV.delete 'ghprbPullId'
    end

    def restore_env_pull_request
      ENV['TRAVIS_PULL_REQUEST'] = @original_travis_pull_request
      ENV['CIRCLE_PR_NUMBER'] = @original_circle_pr_number
      ENV['ghprbPullId'] = @original_ghprb_pull_id
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
env_pull_request-0.3.1 lib/env_pull_request/test_helper.rb
env_pull_request-0.3.0 lib/env_pull_request/test_helper.rb
env_pull_request-0.2.2 lib/env_pull_request/test_helper.rb