Skip to content

Commit 2e2a16d

Browse files
author
Sven Fuchs
committed
revert to test/unit and fix gemspec unit test
1 parent 047d100 commit 2e2a16d

9 files changed

+20
-19
lines changed

Gemfile

-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ source 'http://gemcutter.org'
33
group :test do
44
gem 'test_declarative'
55
gem 'mocha'
6-
gem 'minitest'
76
end

gem-release.gemspec

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Gem::Specification.new do |s|
1717
s.platform = Gem::Platform::RUBY
1818
s.rubyforge_project = '[none]'
1919

20-
s.add_development_dependency 'minitest', '>=1.6.0'
2120
s.add_development_dependency 'test_declarative', '>=0.0.2'
2221
s.add_development_dependency 'mocha', '>=0.9.8'
2322

test/bootstrap_command_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
require 'gem_release/gemspec'
55
require 'fileutils'
66

7-
class BootstrapCommandTest < MiniTest::Unit::TestCase
7+
class BootstrapCommandTest < Test::Unit::TestCase
88
def setup
99
build_sandbox
1010
stub_command(GemspecCommand, :execute)

test/gemspec_command_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'rubygems/commands/bootstrap_command'
44
require 'rubygems/commands/gemspec_command'
55

6-
class GemspecCommandTest < MiniTest::Unit::TestCase
6+
class GemspecCommandTest < Test::Unit::TestCase
77
def setup
88
build_sandbox
99
stub_command(GemspecCommand, :say)

test/gemspec_test.rb

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'gem_release/version'
44
require 'gem_release/gemspec'
55

6-
class GemspecTest < MiniTest::Unit::TestCase
6+
class GemspecTest < Test::Unit::TestCase
77
include Gem::Commands
88

99
test 'scaffolds a gemspec with default values' do
@@ -24,15 +24,20 @@ class GemspecTest < MiniTest::Unit::TestCase
2424
assert_equal '[description]', gemspec.description
2525

2626
assert_match %r(require 'gem_release/version'), source
27-
28-
assert_match %r(files\s*=[^$]*git ls\-files), source
27+
assert_match %r(files\s*=\s*Dir.glob\(\"lib\/\*\*\/\*\*\"\)), source
2928
end
3029

3130
test 'scaffolds a gemspec with glob strategy' do
3231
source = GemRelease::Gemspec.new(:strategy => 'glob').render
3332
gemspec = eval(source)
3433
assert_match %r(files\s*=\s*Dir.glob\(\"lib\/\*\*\/\*\*\"\)), source
3534
end
35+
36+
test 'scaffolds a gemspec with git strategy' do
37+
source = GemRelease::Gemspec.new(:strategy => 'git').render
38+
gemspec = eval(source)
39+
assert_match %r(files\s*=[^$]*git ls\-files), source
40+
end
3641

3742
test 'filename' do
3843
assert_equal 'gem-release.gemspec', GemRelease::Gemspec.new.filename

test/helpers_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require 'rubygems/commands/release_command'
44

5-
class HelpersTest < MiniTest::Unit::TestCase
5+
class HelpersTest < Test::Unit::TestCase
66
include Gem::Commands
77

88
test "gems_filename" do

test/release_command_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'rubygems/commands/release_command'
44
require 'gem_release/version'
55

6-
class ReleaseCommandTest < MiniTest::Unit::TestCase
6+
class ReleaseCommandTest < Test::Unit::TestCase
77
include Gem::Commands
88

99
def setup

test/tag_command_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require 'rubygems/commands/tag_command'
44

5-
class TagCommandTest < MiniTest::Unit::TestCase
5+
class TagCommandTest < Test::Unit::TestCase
66
include Gem::Commands
77

88
def setup

test/test_helper.rb

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
$: << File.expand_path('../../lib', __FILE__)
22

3-
require 'minitest/unit'
4-
require 'test_declarative'
5-
require 'mocha'
6-
73
require 'rubygems'
84
require 'rubygems_plugin'
95

10-
MiniTest::Unit.autorun
6+
require 'test/unit'
7+
require 'test_declarative'
8+
require 'mocha'
119

12-
class MiniTest::Unit::TestCase
10+
class Test::Unit::TestCase
1311
include Gem::Commands
1412

1513
def build_sandbox
1614
@cwd = Dir.pwd
17-
FileUtils.mkdir_p('tmp/foo-bar')
18-
Dir.chdir('tmp/foo-bar')
15+
FileUtils.mkdir_p('tmp/gem-release-test/foo-bar')
16+
Dir.chdir('tmp/gem-release-test/foo-bar')
1917
end
2018

2119
def teardown_sandbox
2220
Dir.chdir(@cwd)
23-
FileUtils.rm_r('tmp/foo-bar')
21+
FileUtils.rm_r('tmp/gem-release-test/foo-bar')
2422
end
2523

2624
def stub_command(command_class, *methods)

0 commit comments

Comments
 (0)