summaryrefslogtreecommitdiff
path: root/lib/rubygems/test_case.rb
AgeCommit message (Collapse)Author
2020-07-31[rubygems/rubygems] unset XDG_* environmental variables for testing of rubygems.Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/539fd9a39a Notes: Merged: https://github.com/ruby/ruby/pull/3379
2020-07-31[rubygems/rubygems] Revert "Disallow warnings to creep into the test suite"David Rodríguez
This reverts commit 694e6afee769ffb3168a564ee7d315af2a934993. It was failed on Windows and I'm unsure why. Also, the check seems brittle since it could fail potentially fail because of warnings outside of our control. https://github.com/rubygems/rubygems/commit/908e9344dd Notes: Merged: https://github.com/ruby/ruby/pull/3379
2020-07-31[rubygems/rubygems] Disallow warnings to creep into the test suiteDavid Rodríguez
https://github.com/rubygems/rubygems/commit/694e6afee7 Notes: Merged: https://github.com/ruby/ruby/pull/3379
2020-07-31[rubygems/rubygems] Fix test warningDavid Rodríguez
https://github.com/rubygems/rubygems/commit/f4c4cddb68 Notes: Merged: https://github.com/ruby/ruby/pull/3379
2020-07-31[rubygems/rubygems] Don't `super` on main test setupDavid Rodríguez
The `teardown` method doesn't call it either and I don't think it's necessary. https://github.com/rubygems/rubygems/commit/ca2a5d485d Notes: Merged: https://github.com/ruby/ruby/pull/3379
2020-07-31[rubygems/rubygems] Remove very old compatibility codeDavid Rodríguez
https://github.com/rubygems/rubygems/commit/6e4bef758b Notes: Merged: https://github.com/ruby/ruby/pull/3379
2020-07-31Enforce no empty lines around class body in rubygemsDavid Rodríguez
To normalize the code style with `bundler`. Notes: Merged: https://github.com/ruby/ruby/pull/3379
2020-06-17Remove unnecessary stuff from base test caseDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/3213
2020-06-17Tweaks to play nicer with ruby-core parallelized testsDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/3213
2020-06-17Make sure to only reset "dummy" $LOADED_FEATURESDavid Rodríguez
Namely, those generated under `/tmp`. The previous approach was brittle and broken in the case of ruby-core, because under that setup, the current folder is in the original `$LOAD_PATH`, and dummy features are created under `./tmp`, so they were failing to be reset. Notes: Merged: https://github.com/ruby/ruby/pull/3213
2020-06-17Make sure tmp folder exists before calling `Dir.tmpdir`David Rodríguez
This was guaranteed by our gitignore setup where a `tmp/` folder is always present right after cloning the repository, but was not guaranteed under the ruby-core setup. This alternative approach should always work. Notes: Merged: https://github.com/ruby/ruby/pull/3213
2020-06-17Revert "Revert "[rubygems/rubygems] Use a local temporary directory""David Rodríguez
This reverts commit 20971d0df41368e0f946683823bc786514e16fef. Notes: Merged: https://github.com/ruby/ruby/pull/3213
2020-06-15Use space inside block braces everywhereDavid Rodríguez
To make rubygems code style consistent with bundler. Notes: Merged: https://github.com/ruby/ruby/pull/3229
2020-06-15Fix ruby-head failing testsDavid Rodríguez
In `ruby-head` (where system rubygems already has the `XDG` standard implementation), some tests currently depend on the presence of a `~/.gem` folder in the home of the user that runs the tests. If that file is present, tests pass, otherwise they don't. For example, the following passes if you have a `~/.gem` folder but fails otherwise with: ``` $ rake TESTOPTS="--name=/TestGemCommandsGenerateIndexCommand#test_execute$\|TestGemCommandsUpdateCommand#test_execute_user_install/ -v" Run options: "--name=/TestGemCommandsGenerateIndexCommand#test_execute$|TestGemCommandsUpdateCommand#test_execute_user_install/" -v --seed 17318 # Running: TestGemCommandsGenerateIndexCommand#test_execute = 0.02 s = . TestGemCommandsUpdateCommand#test_execute_user_install = /rubygems/test/rubygems/test_gem_commands_update_command.rb:412: warning: instance variable @user_install not initialized 0.04 s = F Finished in 0.095337s, 20.9783 runs/s, 20.9783 assertions/s. 1) Failure: TestGemCommandsUpdateCommand#test_execute_user_install [/rubygems/test/rubygems/test_gem_commands_update_command.rb:414]: user_install must be set on the installer 2 runs, 2 assertions, 1 failures, 0 errors, 0 skips rake aborted! Command failed with status (1) Tasks: TOP => default => test (See full trace by running task with --trace) ``` This is because the very initial `require` of the default `did_you_mean` gem that ruby does on startup runs _before_ the global `setup` hook of our tests run. During this require `Gem.data_home` and its value is memoized to a path in the real users home (not the fake user's home that our tests setup, since that code hasn't run yet). Then that memoized value is used when looking for the default folders to look for gems, and since there's no `~/.gem` folder, its value is actually used as part of the `Gem.user_dir` folder in `Gem::Specification.dirs` (this is how we've approached backwards compatibility for the `XDG` feature). That means dummy test gems with the `--user-install` flag are installed to global, real locations and everything is messed up. This commit fixes the issue by resetting the `Gem.data_home` value in case it has already been memoized. Notes: Merged: https://github.com/ruby/ruby/pull/3211
2020-06-15Revert "Revert "[rubygems/rubygems] Remove unneeded global teardown""David Rodríguez
This reverts commit ac2c07e98373bb62be618001c897fa9d5809d8a4. Notes: Merged: https://github.com/ruby/ruby/pull/3211
2020-06-05[rubygems/rubygems] Respect files loaded from default gems before rubygemsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/f3da3c1190 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Fix performance regression in `require`David Rodríguez
Our check for `-I` paths should not go through all activated gems. https://github.com/rubygems/rubygems/commit/00d98eb8a3 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-05-08Revert "[rubygems/rubygems] Remove unneeded global teardown"Hiroshi SHIBATA
This reverts commit 93d1588c782ab9d61699f98b6c64d7f0ab8121c0. Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08Revert "[rubygems/rubygems] Use a local temporary directory"Hiroshi SHIBATA
This reverts commit e98455f289047c43a733e61ac6317fb74b68de82. Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Remove unneeded global teardownDavid Rodríguez
Instead, make each test cleanup after itself. https://github.com/rubygems/rubygems/commit/e0aba9d64f Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Split credential helper as credential_setup and use itHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/b0c55c76ca Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Suppress warnings coming from `jar-dependencies`David Rodríguez
This is a default gem on jruby, which ships with a rubygems plugin, which prints warnings all over the place during our tests. This plugin is unnecessary from our tests, so I disable it through the `JARS_SKIP` environment variable provided by this gem. https://github.com/rubygems/rubygems/commit/0aabbcf269 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08Remove `builder` gem requirement for `gem regenerate_index`David Rodríguez
This requirement was introduced 14 years ago in 7ce7039b390440754954df5efea619e9f57ef823, and I don't think it's necessary anymore. I made several tests introducing UTF-8 characters in gemspec files and generating indexes out of them, and couldn't find any issues. Gemspecs are read with UTF-8 encoding these days. Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Use a local temporary directoryDavid Rodríguez
To make tests more deterministic, since `Dir.tmpdir` sometimes will return the current directory dependending on the writability of other paths, and in that case since the current directory is changed by our tests, tests can fail. Force a local tmp folder instead, which will always be writable. https://github.com/rubygems/rubygems/commit/3e522bac65 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] No longer necessaryDavid Rodríguez
Fixed in https://github.com/ruby/ruby/commit/45df1c24d269f93a2bc1e7a6fe0ffcecc1193051, released with ruby 2.3 https://github.com/rubygems/rubygems/commit/f8f67f3952 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Refactor ruby command line building for testsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/43819b6973 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Remove unnecessary `@@ruby` variableDavid Rodríguez
https://github.com/rubygems/rubygems/commit/5f20647ec1 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Add gem build test to check for removed methods.Josef Šimánek
https://github.com/rubygems/rubygems/commit/c07b9cf4f1 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Removed deprecated methods for Minitest5Hiroshi SHIBATA
It was migrated on ruby core repository too. https://github.com/ruby/ruby/commit/e5db3da9d34f0a7595208863301c044b612adbed https://github.com/rubygems/rubygems/commit/848bbe3c76 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Minitest::Test is works fine with the ruby core repositoryHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/afa01a29a3 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Revert https://github.com/rubygems/rubygems/pull/3445Hiroshi SHIBATA
These changes completely broke the test suite on ruby core repository. https://github.com/rubygems/rubygems/commit/84b0bea3e1 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Don't swallow gem activation exceptionDavid Rodríguez
Our tests are now guaranteed to not work on older versions of minitest, so I don't think we should swallow this activation error because it will make it very clear for the user what the problem is if she has a minitest version not satisfying the requirement. https://github.com/rubygems/rubygems/commit/a291b65369 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] Remove minitest compatibility codeDavid Rodríguez
https://github.com/rubygems/rubygems/commit/24213b97d8 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-05-08[rubygems/rubygems] [rubygems/rubygems] Require minitest `~> 5.13`David Rodríguez
https://github.com/rubygems/rubygems/commit/f2cc5d7033 https://github.com/rubygems/rubygems/commit/ae5b4e2043 Notes: Merged: https://github.com/ruby/ruby/pull/3087
2020-04-25Clear cached XDG path namesNobuyoshi Nakada
2020-04-23Support XDG_* (#2174)Hiroshi SHIBATA
* Support XDG_CONFIG_HOME for gemrc. * Support XDG_DATA_HOME for .gem * Added test for XDG_DATA_HOME * Do not reuse environmental variable. * Unify .rdoc path to RDoc.home. * Support XDG_DATA_HOME for .rdoc * Ignore exists? * Extracted config_home path * Use XDG_CONFIG_HOME for default credential path * Fixed inconsistency location. * Fixed the broken tests. * Support XDG_CONFIG_HOME for irbrc * Introduce Gem.cache_home as XDG_CACHE_HOME * Use Gem.cache_home instead of Gem.config_home for the credential file of RubyGems. * Initialized the old configurations * Fixed test failure related the configuration initialization * restore XDG_DATA_HOME * Fixed the broken examples of bundler with XDG_* * Do not modify environmental variable on test file * Use XDG_DATA_HOME insted of XDG_CACHE_HOME for credential file * stub out Gem.data_home * Move dir accessor to defaults.rb file * Use XDG_DATA_HOME for signed gem features * Use XDG_DATA_HOME for spec cache * Do not rely on Gem.user_home * Gem.user_home is always exists. Don't need to use FileUitls.mkdir_p * Bump support version to RubyGems 3.2.0+ * Removed the needless fallback configuration * Fixed the inconsistency methods that are find_config_file and config_file * Use Gem.configuration.credentials_path instead of hard-coded path * gem_path is always provided * Removed the duplicated code of find_home * Also removed the duplicated code of user_home * use Gem::UNTAINT instead of untaint for surpressing the warnings * Use File.directory * Restore XDG_DATA_HOME * Use File.write Notes: Merged-By: hsbt <hsbt@ruby-lang.org>
2020-03-30Migrate {assert,refute}_patch_exits for compatibility with Minitest5Hiroshi SHIBATA
2020-03-30[rubygems/rubygems] Remove ruby 1.8 leftoversDavid Rodríguez
https://github.com/rubygems/rubygems/commit/84c89275b8
2020-03-30[rubygems/rubygems] Enable `Style/ExtraSpacing` and auto-correctDavid Rodríguez
https://github.com/rubygems/rubygems/commit/6fa0b1b679
2020-03-30[rubygems/rubygems] Enable Style/PercentLiteralDelimiters cop in rubygemsDavid Rodríguez
So it matches the style used by bundler. https://github.com/rubygems/rubygems/commit/ab0580fd65
2020-03-24Sync rubygems with current master (#2889)David Rodríguez
Notes: Merged-By: hsbt <hsbt@ruby-lang.org>
2020-02-01Merge the current master branch of rubygems/rubygems.Hiroshi SHIBATA
Just started to develop RubyGems 3.2.0.
2019-12-20Merge RubyGems 3.1.2Hiroshi SHIBATA
2019-11-11Merge RubyGems 3.1.0.pre3Hiroshi SHIBATA
* Fix gem pristine not accounting for user installed gems. Pull request #2914 by Luis Sagastume. * Refactor keyword argument test for Ruby 2.7. Pull request #2947 by SHIBATA Hiroshi. * Fix errors at frozen Gem::Version. Pull request #2949 by Nobuyoshi Nakada. * Remove taint usage on Ruby 2.7+. Pull request #2951 by Jeremy Evans. * Check Manifest.txt is up to date. Pull request #2953 by David Rodríguez. * Clarify symlink conditionals in tests. Pull request #2962 by David Rodríguez. * Update command line parsing to work under ps. Pull request #2966 by David Rodríguez. * Properly test `Gem::Specifications.stub_for`. Pull request #2970 by David Rodríguez. * Fix Gem::LOADED_SPECS_MUTEX handling for recursive locking. Pull request #2985 by MSP-Greg. Notes: Merged: https://github.com/ruby/ruby/pull/2666
2019-08-18$LOAD_PATH elements should be real pathsNobuyoshi Nakada
Installed path may contain symbolic links.
2019-08-17Revert "Revert "[rubygems/rubygems] [Require] Ensure -I beats a default gem""Hiroshi SHIBATA
This reverts commit 75d29db8f965893bb6ab38b9008abc80cdda246e.
2019-08-17Revert "[rubygems/rubygems] [Require] Ensure -I beats a default gem"Hiroshi SHIBATA
This reverts commit 00cd5d74cecb6aa4a184e57e2b8246ef6e45d458.
2019-08-17[rubygems/rubygems] [Require] Ensure -I beats a default gemSamuel Giddins
https://github.com/rubygems/rubygems/commit/6fbda98eb3
2019-07-31[rubygems/rubygems] Enable `Layout/EmptyLinesAroundAccessModifier`David Rodríguez
https://github.com/rubygems/rubygems/commit/41b1cebc33
2019-07-31[rubygems/rubygems] There is no usage of @orig_env_* variables in test suite.Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/2adef51dc9