Skip to content

Tests should not fail on existing GEM_HOME/GEM_PATH env variables#18

Open
robfrawley wants to merge 2 commits into
postmodern:masterfrom
src-run-opt:master
Open

Tests should not fail on existing GEM_HOME/GEM_PATH env variables#18
robfrawley wants to merge 2 commits into
postmodern:masterfrom
src-run-opt:master

Conversation

@robfrawley

@robfrawley robfrawley commented Sep 9, 2018

Copy link
Copy Markdown

I changed the push/pop tests to account for the possibility that GEM_HOME and GEM_PATH may be set already in the environment where the tests are being run. Prior, the tests would fail when any values were assigned to the GEM_* variables.

A warning was also added for the unsupported state of having a random combination of the GEM_* variables set and unset: either they must both be assigned a value or neither should be assigned a value, otherwise the tests break. The addition of a large warning makes this clear.

Lastly, some additional test environments were added to ensure that everything functions as expected given the environment where no GEM_* variables are set, as well as the environment where they both are.

… taken into account and add warning for inconsistantly setting said variables to avoid breaks
…GEM_HOME handling is covered

Signed-off-by: Rob Frawley 2nd <rmf@src.run>
@postmodern

Copy link
Copy Markdown
Owner

I don't see the utility in running the tests with GEM_HOME/GEM_PATH set to something else. What we probably should do is unset GEM_HOME/GEM_PATH in test/helper.rb. Since the tests are 100% bash, they don't rely on any rubygems. We could also add tests to simulate when GEM_HOME/GEM_PATH is already set and whether gem_home_pop can properly restore them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants