spec/osgi/library_extension_spec.rb in buildr4osgi-0.9.0 vs spec/osgi/library_extension_spec.rb in buildr4osgi-0.9.2
- old
+ new
@@ -69,9 +69,26 @@
contents.first["Export-Package"].keys.should include("org.slf4j.helpers")
contents.first["Export-Package"].keys.should_not include("org")
}
end
+ it 'should not add the Export-Package header if no packages contain .class files' do
+ pending "Create a zip full of files but no .class files"
+ library_project(SLF4J, "group", "foo", "1.0.0")
+ foo = project("foo")
+ lambda {foo.package(:library_project).invoke}.should_not raise_error
+ jar = File.join(foo.base_dir, "target", "foo-1.0.0.jar")
+ File.exists?(jar).should be_true
+ Zip::ZipFile.open(jar) {|zip|
+ manifest = zip.find_entry("META-INF/MANIFEST.MF")
+ manifest.should_not be_nil
+ contents = Manifest.read(zip.read(manifest))
+ contents.first["Export-Package"].should_not be_nil
+ contents.first["Export-Package"].keys.should include("org.slf4j.helpers")
+ contents.first["Export-Package"].keys.should_not include("org")
+ }
+ end
+
it 'should produce a zip of the sources' do
library_project(SLF4J, "group", "foo", "1.0.0")
foo = project("foo")
lambda {foo.package(:sources).invoke}.should_not raise_error
sources = File.join(foo.base_dir, "target", "foo-1.0.0-sources.zip")
\ No newline at end of file