test/test_hoe.rb in hoe-3.6.3 vs test/test_hoe.rb in hoe-3.7.0
- old
+ new
@@ -12,10 +12,11 @@
class TestHoe < Minitest::Test
def hoe
@hoe ||= Hoe.spec("blah") do
developer 'author', 'email'
+ license 'MIT'
end
end
def teardown
Rake.application.clear
@@ -151,10 +152,11 @@
open 'History.rdoc', 'w' do |io| io.puts '=== 1.0' end
hoe = Hoe.spec 'blah' do
self.version = '1.0'
developer 'nobody', 'nobody@example'
+ license 'MIT'
end
assert_equal 'History.rdoc', hoe.history_file
assert_equal 'README.rdoc', hoe.readme_file
assert_equal %w[FAQ.rdoc History.rdoc README.rdoc],
@@ -177,10 +179,11 @@
open 'History.rdoc', 'w' do |io| io.puts '=== 1.0' end
hoe = Hoe.spec 'blah' do
self.version = '1.0'
developer 'nobody', 'nobody@example'
+ license 'MIT'
end
assert_equal 'README.ja.rdoc', hoe.readme_file
end
end
@@ -235,10 +238,11 @@
def test_possibly_better
t = Gem::Specification::TODAY
hoe = Hoe.spec("blah") do
self.version = '1.2.3'
developer 'author', 'email'
+ license 'MIT'
end
files = File.read("Manifest.txt").split(/\n/) + [".gemtest"]
spec = hoe.spec
@@ -286,23 +290,24 @@
defined? ::RubyForge
assert_equal expected, deps.map { |dep|
[dep.name, dep.type, dep.requirement.to_s]
}
-
- # flunk "not yet"
end
def test_no_license
- hoe = Hoe.spec("blah") do
- self.version = '1.2.3'
- developer 'author', 'email'
+ out, err = capture_io do
+ hoe = Hoe.spec("blah") do
+ self.version = '1.2.3'
+ developer 'author', 'email'
+ end
+
+ assert_equal ["MIT"], hoe.spec.licenses
end
- spec = hoe.spec
-
- assert spec.licenses.empty?
+ assert_equal "", out
+ assert_match "Defaulting gemspec to MIT", err
end
def test_license
hoe = Hoe.spec("blah") do
self.version = '1.2.3'
@@ -351,10 +356,11 @@
end
def test_read_manifest
hoe = Hoe.spec 'blah' do
developer 'author', 'email'
+ license 'MIT'
end
expected = File.read_utf('Manifest.txt').split
assert_equal expected, hoe.read_manifest
@@ -373,9 +379,10 @@
def test_nosudo
hoe = Hoe.spec("blah") do
self.version = '1.2.3'
developer 'author', 'email'
+ license 'MIT'
def system cmd
cmd
end
end