spec/osgi/library_extension_spec.rb in buildr4osgi-0.9.2 vs spec/osgi/library_extension_spec.rb in buildr4osgi-0.9.3

- old
+ new

@@ -90,11 +90,11 @@ 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") + sources = File.join(foo.base_dir, "target", "foo-1.0.0-sources.jar") File.exists?(sources).should be_true Zip::ZipFile.open(sources) {|zip| zip.find_entry("org/slf4j/Marker.java").should_not be_nil } end @@ -153,7 +153,20 @@ it "should work inside a container project" do define('container') do lambda {library_project(SLF4J, "org.nuxeo.libs", "org.nuxeo.logging", "1.1.2", :manifest => {"Require-Bundle" => "org.apache.log4j"})}.should_not raise_error(NoMethodError) end - end + end + + it "should not add a manifest Export-Package entry if that package was excluded" do + library_project(SLF4J, "org.hello.libs", "org.hello.logging", "1.1.2", :exclude => "org/slf4j/impl/*") + foo = project("org.hello.logging") + foo.package(:library_project).invoke + jar = File.join(foo.base_dir, "target", "org.hello.logging-1.1.2.jar") + File.exists?(jar).should be_true + Zip::ZipFile.open(jar) {|zip| + zip.find_entry("org/slf4j/impl").should be_nil + zip.find_entry("org/slf4j/helpers").should_not be_nil + zip.read("META-INF/MANIFEST.MF").should_not match /org\.slf4j\.impl/ + } + end end \ No newline at end of file