forked from svenfuchs/gem-release
/
test_release.rb
59 lines (49 loc) · 1.47 KB
/
test_release.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
require 'pathname'
require 'rubygems'
require 'ruby-debug'
require File.expand_path('../../test_helper', __FILE__)
$: << File.expand_path('../../../lib', __FILE__)
require 'rubygems/commands/bump_command'
require 'rubygems/commands/bootstrap_command'
require 'rubygems/commands/release_command'
class TestRecurse < Test::Unit::TestCase
def setup
@cwd=Dir.pwd
@recursive_specs=['tmp/gem-release-test/repo/',
'tmp/gem-release-test/repo/spec1',
'tmp/gem-release-test/repo/spec2',
'tmp/gem-release-test/repo/spec3',
'tmp/gem-release-test/repo/spec3/spec4']
@recursive_specs.each do |dir|
project = dir.split('/').last
FileUtils.mkdir_p(dir)
Dir.chdir(dir)
bs = BootstrapCommand.new
bs.send(:write_scaffold)
bs.send(:write_gemspec)
FileUtils.touch("#{project}.gemspec")
Dir.chdir(@cwd)
end
@bump_command=klass.new
Dir.chdir('tmp/gem-release-test/repo')
end
def teardown
Dir.chdir(@cwd)
FileUtils.rm_rf('tmp')
end
test "truth" do
assert true
end
test "can instantiate bump command" do
assert defined?(Gem::Commands::ReleaseCommand)
assert_kind_of ReleaseCommand, klass.new
end
protected
def klass
Gem::Commands::ReleaseCommand
end
def specs
['repo.gemspec', 'spec1/spec1.gemspec', 'spec2/spec2.gemspec',
'spec3/spec3.gemspec', 'spec3/spec4/spec4.gemspec']
end
end