rubygems-test 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ === 0.4.1 / 2011-04-26
2
+
3
+ * Fix for situations during on-install testing where the gem dir is not available (f.e., on a new installation)
4
+
1
5
  === 0.4.0 / 2011-04-23
2
6
 
3
7
  * Make rc1 official 0.4.0
@@ -15,7 +15,7 @@ class Gem::Commands::TestCommand < Gem::Command
15
15
  include Gem::VersionOption
16
16
  include Gem::DefaultUserInteraction
17
17
 
18
- VERSION = "0.4.0"
18
+ VERSION = "0.4.1"
19
19
 
20
20
  # taken straight out of rake
21
21
  DEFAULT_RAKEFILES = ['rakefile', 'Rakefile', 'rakefile.rb', 'Rakefile.rb']
@@ -32,7 +32,7 @@ class Gem::Commands::TestCommand < Gem::Command
32
32
  "#{program_name} GEM [-v VERSION] [--force] [--dep-user-install]"
33
33
  end
34
34
 
35
- def initialize(spec=nil, on_install=false)
35
+ def initialize(spec=nil, on_install=false, gem_dir=nil)
36
36
  options = { }
37
37
 
38
38
  if spec
@@ -40,6 +40,8 @@ class Gem::Commands::TestCommand < Gem::Command
40
40
  options[:version] = spec.version
41
41
  end
42
42
 
43
+ @spec = spec
44
+ @gem_dir = gem_dir
43
45
  @on_install = on_install
44
46
 
45
47
  super 'test', description, options
@@ -499,14 +501,20 @@ class Gem::Commands::TestCommand < Gem::Command
499
501
  end
500
502
  [tmpdir, inst.spec]
501
503
  else
502
- spec = find_gem(name, version)
503
504
 
504
- unless spec
505
- say "unable to find gem #{name} #{version}"
506
- next
507
- end
505
+ if @spec and @gem_dir and File.directory?(@gem_dir)
506
+ [@gem_dir, @spec]
507
+ else
508
+
509
+ spec = find_gem(name, version)
508
510
 
509
- [spec.full_gem_path, spec]
511
+ unless spec
512
+ say "unable to find gem #{name} #{version}"
513
+ next
514
+ end
515
+
516
+ [spec.full_gem_path, spec]
517
+ end
510
518
  end
511
519
 
512
520
  if File.exist?(File.join(path, '.gemtest')) or options[:force]
@@ -11,7 +11,8 @@ Gem.post_build do |gem|
11
11
  gem.ui.ask_yes_no("Test #{gem.spec.name} (#{gem.spec.version})?", true)
12
12
 
13
13
  begin
14
- Gem::Commands::TestCommand.new(gem.spec, true).execute
14
+ # HACK: request gem_dir be exposed in rubygems
15
+ Gem::Commands::TestCommand.new(gem.spec, true, gem.instance_variable_get(:@gem_dir) || gem.instance_variable_get("@gem_dir")).execute
15
16
  true
16
17
  rescue Gem::RakeNotFoundError, Gem::TestError
17
18
  !(
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: rubygems-test
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.0
5
+ version: 0.4.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Erik Hollensbe
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-04-23 00:00:00 Z
14
+ date: 2011-04-26 00:00:00 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake