RubyGemTestCase provides a variety of methods for testing rubygems and gem-related behavior in a sandbox. Through RubyGemTestCase you can install and uninstall gems, fetch remote gems through a stub fetcher and be assured your normal set of gems is not affected.

Constants
No documentation available
No documentation available
Class Methods

Is this test being run on a Java platform?

Returns the make command for the current platform. For versions of Ruby built on MS Windows with VC++ or Borland it will return ‘nmake’. On all other platforms, including Cygwin, it will return ‘make’.

Allows tests to use a random (but controlled) port number instead of a hardcoded one. This helps CI tools when running parallels builds on the same builder slave.

Finds the path to the Ruby executable

Returns whether or not we’re on a version of Ruby built with VC++ (or Borland) versus Cygwin, Mingw, etc.

Is this test being run on a Windows platform?

Instance Methods

Add spec to +@fetcher+ serving the data in the file path. repo indicates which repo to make spec appear to be in.

No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

TODO: move to minitest

Sets the bindir entry in RbConfig::CONFIG to value and restores the original value when the block ends

Allows the proper version of rake to be used for the test.

No documentation available
No documentation available

Sets the ENABLE_SHARED entry in RbConfig::CONFIG to value and restores the original value when the block ends

Sets the EXEEXT entry in RbConfig::CONFIG to value and restores the original value when the block ends

A git_gem is used with a gem dependencies file. The gem created here has no files, just a gem specification for the given name and version.

Yields the specification to the block, if given

Skips this test unless you have a git executable

Installs the provided default specs including writing the spec file

Install the provided default specs

Builds and installs the Gem::Specification spec

Builds and installs the Gem::Specification spec into the user dir

Install the provided specs

Is this test being run on a Java platform?

No documentation available

Returns the make command for the current platform. For versions of Ruby built on MS Windows with VC++ or Borland it will return ‘nmake’. On all other platforms, including Cygwin, it will return ‘make’.

Enables pretty-print for all tests

No documentation available

Returns whether or not the nmake command could be found.

No documentation available

Creates a Gem::Specification with a minimum of extra work. name and version are the gem’s name and version, platform, author, email, homepage, summary and description are defaulted. The specification is yielded for customization.

The gem is added to the installed gems in +@gemhome+ and the runtime.

Use this with write_file to build an installed gem.

Reads a binary file at path

Reads a Marshal file at path

TODO: move to minitest

No documentation available
No documentation available

setup prepares a sandboxed location to install gems. All installs are directed to a temporary directory. All install plugins are removed.

If the RUBY environment variable is set the given path is used for Gem::ruby. The local platform is set to i386-mswin32 for Windows or i686-darwin8.10.1 otherwise.

teardown restores the process to its original state and removes the tempdir

Uninstalls the Gem::Specification spec

No documentation available

Builds a gem from spec and places it in File.join @gemhome, 'cache'. Automatically creates files based on spec.files

No documentation available

Removes all installed gems from +@gemhome+.

Creates a gem with name, version and deps. The specification will be yielded before gem creation for customization. The gem will be placed in File.join @tempdir, 'gems'. The specification and .gem file location are returned.

Gzips data.

Creates several default gems which all have a lib/code.rb file. The gems are not installed but are available in the cache dir.

+@a1+

gem a version 1, this is the best-described gem.

+@a2+

gem a version 2

+@a3a

gem a version 3.a

+@a_evil9+

gem a_evil version 9, use this to ensure similarly-named gems don’t collide with a.

+@b2+

gem b version 2

+@c1_2+

gem c version 1.2

+@pl1+

gem pl version 1, this gem has a legacy platform of i386-linux.

Additional prerelease gems may also be created:

+@a2_pre+

gem a version 2.a

TODO: nuke this and fix tests. this should speed up a lot

No documentation available
No documentation available
No documentation available

Set the platform to arch

Sets up Gem::SpecFetcher to return information from the gems in specs.

Creates a spec with name, version. deps can specify the dependency or a block can be given for full customization of the specification.

Deflates data

Returns whether or not we’re on a version of Ruby built with VC++ (or Borland) versus Cygwin, Mingw, etc.

Sets the vendordir entry in RbConfig::CONFIG to value and restores the original value when the block ends

In case we’re building docs in a background process, this method waits for that process to exit (or if it’s already been reaped, or never happened, swallows the Errno::ECHILD error).

Is this test being run on a Windows platform?

No documentation available

Writes a binary file to path which is relative to +@gemhome+