test/test_hoe.rb in hoe-3.0.8 vs test/test_hoe.rb in hoe-3.1.0
- old
+ new
@@ -317,9 +317,57 @@
}
# flunk "not yet"
end
+ def test_no_license
+ hoe = Hoe.spec("blah") do
+ self.version = '1.2.3'
+ developer 'author', 'email'
+ end
+
+ spec = hoe.spec
+
+ assert spec.licenses.empty?
+ end
+
+ def test_license
+ hoe = Hoe.spec("blah") do
+ self.version = '1.2.3'
+ developer 'author', 'email'
+ license 'MIT'
+ end
+
+ spec = hoe.spec
+
+ assert_equal %w(MIT), spec.licenses
+ end
+
+ def test_multiple_calls_to_license
+ hoe = Hoe.spec("blah") do
+ self.version = '1.2.3'
+ developer 'author', 'email'
+ license 'MIT'
+ license 'GPL-2'
+ end
+
+ spec = hoe.spec
+
+ assert_equal %w(MIT GPL-2), spec.licenses
+ end
+
+ def test_setting_licenses
+ hoe = Hoe.spec("blah") do
+ self.version = '1.2.3'
+ developer 'author', 'email'
+ self.licenses = ['MIT', 'GPL-2']
+ end
+
+ spec = hoe.spec
+
+ assert_equal %w(MIT GPL-2), spec.licenses
+ end
+
def test_plugins
before = Hoe.plugins.dup
Hoe.plugin :first, :second
assert_equal before + [:first, :second], Hoe.plugins