summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem.rb
AgeCommit message (Collapse)Author
2021-08-31[rubygems/rubygems] Remove helper method not buying us muchDavid Rodríguez
https://github.com/rubygems/rubygems/commit/81dc685d20 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove MacOS specific extra GEM_PATHDavid Rodríguez
They should properly configure `GEM_PATH` instead. https://github.com/rubygems/rubygems/commit/3bd9ae33ca Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Also load user installed rubygems pluginsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/82960c262f Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Recommend `bundle install` rather than `gem install -g`David Rodríguez
https://github.com/rubygems/rubygems/commit/4028cbc408 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Refactor reseting `RUBYGEMS_GEMDEPS` in testsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/91dca11112 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Use `Gem.use_gemdeps` only from binstubsDavid Rodríguez
The previous behavior was to automatically require `bundler/setup` everytime `rubygems` was required, which I think was too much. https://github.com/rubygems/rubygems/commit/b25379a295 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove misleading commentDavid Rodríguez
When I read, I thought the assertion was incorrect. It's doing the right thing, though. https://github.com/rubygems/rubygems/commit/e72c27367a Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove unnecessary spec manipulationDavid Rodríguez
https://github.com/rubygems/rubygems/commit/c7c00c280f Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-08-31[rubygems/rubygems] Remove redundant part of error messageDavid Rodríguez
It doesn't really add much, in my opinion. We want to be helpful, but also concise when possible. https://github.com/rubygems/rubygems/commit/9d56009cf7 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-06-03[rubygems/rubygems] Rename test/rubygems/test_{case,utilities}.rb to avoid ↵Yusuke Endoh
"test_" prefix This changes "test/rubygems/test_case.rb" to "test/rubygems/helper.rb", and "test/rubygems/test_utilities.rb" to "test/rubygems/utilities.rb". The two files are a helper for tests, not test files. However, a file starting with "test_" prefix is handled as a test file directly loaded by test-unit because Rakefile specifies: ``` t.test_files = FileList['test/**/test_*.rb'] ``` Directly loading test/rubygems/test_utilities.rb caused "uninitialized constant Gem::TestCase". This issue was fixed by 59c682097197fee4052b47e4b4ab86562f3eaa9b, but the fix caused a "circular require" warning because test_utilities.rb and test_case.rb are now requiring each other. Anyway, adding "test_" prefix to a test helper file is confusing, so this changeset reverts the fix and solve the issue by renaming them. https://github.com/rubygems/rubygems/commit/6460e018df
2021-05-28[rubygems/rubygems] Use pend instead of skipHiroshi SHIBATA
2021-05-28[rubygems/rubygems] Require the new files in `test/` relativelyDavid Rodríguez
https://github.com/rubygems/rubygems/commit/c77868a555
2021-05-12[rubygems/rubygems] Use assert_raise instead of assert_raisesHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/769e87f011 Notes: Merged: https://github.com/ruby/ruby/pull/4491
2021-05-12[rubygems/rubygems] Use assert_path_exist and assert_path_not_exist instead ↵Hiroshi SHIBATA
of assert_path_exists and refute_path_exists https://github.com/rubygems/rubygems/commit/a7c93558c3 Notes: Merged: https://github.com/ruby/ruby/pull/4491
2021-05-12[rubygems/rubygems] Extract assert_output to assert_empty and assert_equal ↵Hiroshi SHIBATA
with capture_output https://github.com/rubygems/rubygems/commit/f6759440a4 Notes: Merged: https://github.com/ruby/ruby/pull/4491
2021-05-12[rubygems/rubygems] Use capture_output instead of capture_io.Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/ad9206d4d0 Notes: Merged: https://github.com/ruby/ruby/pull/4491
2021-03-08Sync latest development version of bundler & rubygemsDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/4143
2020-12-08Merge prepare version of RubyGems 3.2.0Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3864
2020-09-23Revert "Manually merged from https://github.com/rubygems/rubygems/pull/2636"Hiroshi SHIBATA
31a6eaabc165d8a222e176f2c809d90622d88ec2 is obsoleted with https://github.com/rubygems/rubygems/pull/3820
2020-09-23Manually merged from https://github.com/rubygems/rubygems/pull/2636Hiroshi SHIBATA
Enable Style/EmptyLinesAroundClassBody rubocop cop.
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-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-05-08[rubygems/rubygems] Require open3 before using itDavid Rodríguez
Otherwise if this test file is run in isolation, this test will fail. https://github.com/rubygems/rubygems/commit/79da003948 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Now `Dir.tmpdir` is fixed and there's never such a folderDavid Rodríguez
https://github.com/rubygems/rubygems/commit/44ebbded12 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Show gemspec location when a Gem::MissingSpecError is ↵bronzdoc
raised while trying to activate a gem https://github.com/rubygems/rubygems/commit/4da54a8e8b Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Fix incorrect bundler version being requiredDavid Rodríguez
In ruby 2.7.0, there's a slight change in bundler's default gemspec file where the executable folder of the bundler gem is `libexec` instead of `exe`. I made that change in https://github.com/ruby/ruby/pull/2380 to try to simplify the integration of the `bundler` gem with upstream, minimizing the number of changes that need to be made to the gemspec to adapt to the structure of ruby-core. That worked ok, expected for this issue. The new name of the folder including the executable files uncovered a bug in rubygems, which is the following: * In order to be able to use newer versions of default gems, `rubygems` ships with a customized `require` that has knowledge about which files belong to which default gem. If one of these files is required, `rubygems` will detect that and activate its gem mechanism to choose the newest version of the corresponding default gem present in the system (unless a different version has already been activated). It's this part of the custom require: https://github.com/rubygems/rubygems/blob/ea3e6f194df500b028b52b3b64decbd3df1d5ab0/lib/rubygems/core_ext/kernel_require.rb#L77-L85 * In order to do that, `rubygems` registers a map of default gems and their files when it is first required: https://github.com/rubygems/rubygems/blob/ea3e6f194df500b028b52b3b64decbd3df1d5ab0/lib/rubygems.rb#L1247-L1276 As explained in the method's header, two types of default gem specifications are supported. One of the formats is the style used by some ruby-core gemspec files, where paths inside the `spec.files` array don't include the `spec.require_paths` part. So in this "old style", if a gem ships with a `lib/bundler.rb` file, it will be registered in this array as `spec.files = ["bundler.rb"]`, not as `spec.files = ["lib/bundler.rb"]`. The `Gem.register_default_spec` method "detects" this style by making sure that none of the files in the `spec.files` array start with any of the `spec.require_paths`. * Since in ruby 2.7 the default specification file of the `bundler` gem includes a `libexec/bundle` file, this check would no longer work correctly, because even though the specification file is still "old style", it has one registered file which starts with "lib", one of the "require paths" of the gem. * This means that the gem is incorrectly detected as "new style", but since none of the paths start with "lib/", no files are actually registered, so the gem is not being considered a default gem, and thus the default version is always used with no possibility of being "upgraded". The fix of the problem is simple: check that no files start with `lib/` (or any other require paths), instead of with "lib" which doesn't exclude other potential "non requirable folder" starting with lib, like in the `bundler` case. https://github.com/rubygems/rubygems/commit/94df740c2b 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 unneeded explicit requiresDavid Rodríguez
https://github.com/rubygems/rubygems/commit/583316bf49 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Remove unneeded dupsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/2f072e3dc7 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Remove unneeded untaintingDavid Rodríguez
https://github.com/rubygems/rubygems/commit/ff223d8489 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Autoload name_tuple.rb before useOlle Jonsson
- Resolver asked Molinillo to resolve-then-activate, which led to using Gem::NameTuple before any require had been passed Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net> https://github.com/rubygems/rubygems/commit/e11782b0c8 Notes: Merged: https://github.com/ruby/ruby/pull/3087
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-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-12-11Do not load q.rb in build directoryKazuhiro NISHIYAMA
Notes: Merged: https://github.com/ruby/ruby/pull/2736
2019-12-11Do not load files in build directoryKazuhiro NISHIYAMA
related https://bugs.ruby-lang.org/issues/16177 Notes: Merged: https://github.com/ruby/ruby/pull/2736
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-10-29test/rubygems/test_gem.rb: early failure when there is /tmp/GemfileYusuke Endoh
Some test cases in rubygems assume that /tmp/Gemfile does not exist. If it does, they fail with very difficult-to-understand message: ``` [ 149/2108] TestGemBundlerVersionFinder#test_bundler_version_with_bundle_update_bundler = 0.00 1) Failure: TestGemBundlerVersionFinder#test_bundler_version_with_bundle_update_bundler [/home/mame/work/ruby/test/rubygems/test_gem_bundler_version_finder.rb:38]: Expected Gem::Version.new("2.0.2") to be nil. ``` I spent one hour to debug this issue. To prevent the same accident, this change makes the test suite stop when /tmp/Gemfile explicitly.
2019-09-26[rubygems/rubygems] Fix underscore version for bundler itselfDavid Rodríguez
Previously it wouldn't play nice with the bundler version finder. https://github.com/rubygems/rubygems/commit/d8bb81556d
2019-08-17[rubygems/rubygems] Autoswitch to exact bundler version if presentDavid Rodríguez
https://github.com/rubygems/rubygems/commit/bb02953a97
2019-07-31[rubygems/rubygems] Silence deprecations when gemdeps is used in testsDavid Rodríguez
Because we can't control 3rd party gems using deprecated rubygems behavior, and thus outputting warnings to the screen. https://github.com/rubygems/rubygems/commit/6912ebf20a
2019-07-24[rubygems/rubygems] Make `@@project_dir` constants per filesNobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/955174658f
2019-07-24[rubygems/rubygems] Resolve `@@project_dir` from test file pathsNobuyoshi Nakada
`Dir.pwd` may differ from the source path. Test directories and files should be resolved from test file paths. https://github.com/rubygems/rubygems/commit/e18e7c81b4
2019-06-01Merge rubygems master from upstream.Hiroshi SHIBATA
I picked the commit from 3c469e0da538428a0ddd94f99aa73c32da22e8ba
2019-04-28Update rubygems with latest upstream changesDavid Rodríguez
Closes: https://github.com/ruby/ruby/pull/2154
2019-04-02Merge rubygems/rubygems from upstream.hsbt
The current master branch is https://github.com/rubygems/rubygems/commit/97b264f0fa248c864b6ee9a23d3ff1cdd217dddb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-05Merge RubyGems upstream: 56c0bbb69e4506bda7ef7f447dfec5db820df20bhsbt
It fixed the multiple vulnerabilities. https://blog.rubygems.org/2019/03/05/security-advisories-2019-03.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e