spec/eclipse/feature_spec.rb in buildr4osgi-0.9.5 vs spec/eclipse/feature_spec.rb in buildr4osgi-0.9.6

- old
+ new

@@ -114,10 +114,11 @@ describe Buildr4OSGi::FeatureTask, "configuration" do it "should accept the feature parameters" do + Buildr::write "p2.inf", "" foo = define("foo", :version => "1.0.0") f = foo.package(:feature) lambda { f.plugins << "com.my:plugin:1.0:jar" f.label = "My feature" @@ -129,10 +130,11 @@ f.licenseURL = "http://example.com/license" f.branding_plugin = "com.musal.ui" f.update_sites << {:url => "http://example.com/update", :name => "My update site"} f.discovery_sites = [{:url => "http://example.com/update2", :name => "My update site2"}, {:url => "http://example.com/upup", :name => "My update site in case"}] + f.p2_inf = "p2.inf" }.should_not raise_error end it "should accept using an existing feature.xml without a feature.properties" do featurexml = <<-FEATURE @@ -203,10 +205,11 @@ end describe Buildr4OSGi::FeatureTask, " when running" do before do + Buildr::write "myp2.inf", "#p2 properties\n" @foo = define("foo", :version => "1.0.0") f = @foo.package(:feature) f.plugins << DEBUG_UI f.label = "My feature" f.provider = "Acme Inc" @@ -216,18 +219,20 @@ f.licenseURL = "http://example.com/license" f.branding_plugin = "com.musal.ui" f.update_sites << {:url => "http://example.com/update", :name => "My update site"} f.discovery_sites = [{:url => "http://example.com/update2", :name => "My update site2"}, {:url => "http://example.com/upup", :name => "My update site in case"}] + f.p2_inf = "myp2.inf" end it "should create a jar file with a eclipse/plugins and a eclipse/features structure" do @foo.package(:feature).invoke feature_file = File.join(@foo.base_dir, "target", "foo-1.0.0.zip") File.exists?(feature_file).should be_true Zip::ZipFile.open(feature_file) do |zip| zip.find_entry("eclipse/features/foo_1.0.0/feature.xml").should_not be_nil zip.find_entry("eclipse/features/foo_1.0.0/feature.properties").should_not be_nil + zip.find_entry("eclipse/features/foo_1.0.0/p2.inf").should_not be_nil zip.find_entry("eclipse/plugins/org.eclipse.debug.ui_3.4.1.v20080811_r341.jar").should_not be_nil end end it 'should complain if one of the dependencies is not a plugin' do \ No newline at end of file