spec/maven_spec.rb in pushwagner-0.0.1.1 vs spec/maven_spec.rb in pushwagner-0.0.1.2

- old
+ new

@@ -25,45 +25,45 @@ it "allows stable versions on artifacts" do m = Pushwagner::Maven.new(cfg, "1bar") expect(m.artifacts["some-notifier"].version).to eq("1.0final") end - describe "initialization of artifacts" do + describe "artifacts" do it "requires at least one artifact" do cfg.delete('artifacts') expect {Pushwagner::Maven.new(cfg, "1bar")}.to raise_error(StandardError, "Requires at least one maven artifact") end it "parses two artifacts" do m = Pushwagner::Maven.new(cfg, "1bar") expect(m.artifacts.size).to eq(2) - expect(m.artifacts.keys.first).to eq("some-api") - expect(m.artifacts.keys.last).to eq("some-notifier") + expect(m.artifacts.keys).to include("some-api") + expect(m.artifacts.keys).to include("some-notifier") end end - describe "initialization of repositories" do - it "requires snapshots repository" do + describe "repositories" do + it "requires repositories configuration element" do cfg.delete('repositories') expect {Pushwagner::Maven.new(cfg, "1")}.to raise_error(StandardError) end - it "requires snapshots repository" do + it "requires 'snapshots' repository" do cfg['repositories'].delete('snapshots') expect {Pushwagner::Maven.new(cfg, "1")}.to raise_error(StandardError) end - it "requires releases repository" do + it "requires 'releases' repository" do cfg['repositories'].delete('releases') expect {Pushwagner::Maven.new(cfg, "1")}.to raise_error(StandardError) end - it "parses repository" do + it "parses repositories" do m = Pushwagner::Maven.new(cfg, "1") expect(m.repository.snapshots_url).to eq("http://w00t.uppercase.no/nexus/content/repositories/snapshots") expect(m.repository.releases_url).to eq("http://w00t.uppercase.no/nexus/content/repositories/releases") end end end - describe "repositories" do + describe "repository authentication" do let(:settings) {IO.read(File.join(config_root, 'settings.xml'))} it "reads releases authentication from maven settings.xml" do m = Pushwagner::Maven.new(cfg, "1") m.repository.should_receive(:open). @@ -79,10 +79,11 @@ with(/.*settings.xml$/). and_return(settings) expect(m.repository.authentication(true)).to eq("bar:baz") end - + end + describe "maven2-style repo support" do let(:metadata) {IO.read(File.join(config_root, 'maven-metadata.xml'))} it "builds maven2-repo-style urls and retrieves metadata" do m = Pushwagner::Maven.new(cfg, "1")