summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRyan Davis <ryand@zenspider.com>2013-07-23 16:13:52 -0800
committerRyan Davis <ryand@zenspider.com>2013-07-23 16:13:52 -0800
commitd93fc123c199e5670799071c3a77fc15790fe3fd (patch)
tree8f8fc0af613cdc5a158080f522ed722f4b70e0b6 /test
parentd99e4b6f614c908fc0b78edda8089d27c0e3304e (diff)
downloadhoe-d93fc123c199e5670799071c3a77fc15790fe3fd.tar.gz
+ Warn and default to MIT license if not set.
[git-p4: depot-paths = "//src/hoe/dev/": change = 8834]
Diffstat (limited to 'test')
-rw-r--r--test/test_hoe.rb23
-rw-r--r--test/test_hoe_publish.rb1
2 files changed, 16 insertions, 8 deletions
diff --git a/test/test_hoe.rb b/test/test_hoe.rb
index cb6c6d4..394c869 100644
--- a/test/test_hoe.rb
+++ b/test/test_hoe.rb
@@ -14,6 +14,7 @@ class TestHoe < Minitest::Test
def hoe
@hoe ||= Hoe.spec("blah") do
developer 'author', 'email'
+ license 'MIT'
end
end
@@ -153,6 +154,7 @@ class TestHoe < Minitest::Test
hoe = Hoe.spec 'blah' do
self.version = '1.0'
developer 'nobody', 'nobody@example'
+ license 'MIT'
end
assert_equal 'History.rdoc', hoe.history_file
@@ -179,6 +181,7 @@ class TestHoe < Minitest::Test
hoe = Hoe.spec 'blah' do
self.version = '1.0'
developer 'nobody', 'nobody@example'
+ license 'MIT'
end
assert_equal 'README.ja.rdoc', hoe.readme_file
@@ -237,6 +240,7 @@ class TestHoe < Minitest::Test
hoe = Hoe.spec("blah") do
self.version = '1.2.3'
developer 'author', 'email'
+ license 'MIT'
end
files = File.read("Manifest.txt").split(/\n/) + [".gemtest"]
@@ -288,19 +292,20 @@ class TestHoe < Minitest::Test
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'
- end
+ out, err = capture_io do
+ hoe = Hoe.spec("blah") do
+ self.version = '1.2.3'
+ developer 'author', 'email'
+ end
- spec = hoe.spec
+ assert_equal ["MIT"], hoe.spec.licenses
+ end
- assert spec.licenses.empty?
+ assert_equal "", out
+ assert_match "Defaulting gemspec to MIT", err
end
def test_license
@@ -353,6 +358,7 @@ class TestHoe < Minitest::Test
def test_read_manifest
hoe = Hoe.spec 'blah' do
developer 'author', 'email'
+ license 'MIT'
end
expected = File.read_utf('Manifest.txt').split
@@ -375,6 +381,7 @@ class TestHoe < Minitest::Test
hoe = Hoe.spec("blah") do
self.version = '1.2.3'
developer 'author', 'email'
+ license 'MIT'
def system cmd
cmd
diff --git a/test/test_hoe_publish.rb b/test/test_hoe_publish.rb
index 067e29f..ee81edd 100644
--- a/test/test_hoe_publish.rb
+++ b/test/test_hoe_publish.rb
@@ -8,6 +8,7 @@ class TestHoePublish < Minitest::Test
self.version = '1.0'
developer 'author', ''
+ license 'MIT'
end
end