Sha256: 59db772e1bc3f0f13865b451eb5ba535db57089b04205954016d66c4acf1f140
Contents?: true
Size: 1.26 KB
Versions: 2
Compression:
Stored size: 1.26 KB
Contents
# Create a test environment for gems. require 'rubygems' require 'rubygems/installer' require 'rubygems/builder' require 'test/mockgemui' require 'rake' module TestEnvironment include Gem::DefaultUserInteraction # Create a testing environment for gems. def create # return if File.exist? "test/data/gemhome/gems/a-0.0.1" Dir.chdir("test/data") do mkdir "lib" unless File.exists? "lib" open("lib/code.rb", "w") do |f| f.puts "CODE = 1" end unless File.exists? "lib/code.rb" spec = Gem::Specification.new do |s| s.files = ['lib/code.rb'] s.name = "a" s.version = "0.0.1" s.summary = "summary" s.description = "desc" s.require_path = 'lib' end use_ui(MockGemUi.new) do Gem::Builder.new(spec).build spec.version = "0.0.2" Gem::Builder.new(spec).build spec.name = 'b' Gem::Builder.new(spec).build spec.name = 'c' spec.version = '1.2' Gem::Builder.new(spec).build FileUtils.mkdir("gemhome") unless File.exist? "gemhome" Gem::Installer.new("a-0.0.1.gem").install(false, "gemhome", false) Gem::Installer.new("a-0.0.2.gem").install(false, "gemhome", false) Gem::Installer.new("b-0.0.2.gem").install(false, "gemhome", false) Gem::Installer.new("c-1.2.gem").install(false, "gemhome", false) end end end extend(self) end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
rubygems-update-0.8.11 | test/gemenvironment.rb |
rubygems-update-0.8.10 | test/gemenvironment.rb |