#TODO get 'spec' into $LOAD by minispec-maven-plugin load File.expand_path(File.join('spec', 'setup.rb')) require 'jbundler/pom' describe JBundler::Pom do it 'should create jar pom without deps' do pom = JBundler::Pom.new("first", "1", []) File.read(pom.file).must_equal "4.0.0ruby.bundlerfirst1" pom.coordinate.must_equal "ruby.bundler:first:jar:1" end it 'should create pom-pom without deps' do pom = JBundler::Pom.new("first", "1", [], 'pom') File.read(pom.file).must_equal "4.0.0ruby.bundlerfirst1pom" pom.coordinate.must_equal "ruby.bundler:first:pom:1" end it 'should create jar pom without deps' do pom = JBundler::Pom.new("second", "1", ["jar \"org.jruby:jruby-core\", '~>1.7.0'"]) File.read(pom.file).must_equal "4.0.0ruby.bundlersecond1org.jrubyjruby-core[1.7.0,1.7.99999]" pom.coordinate.must_equal "ruby.bundler:second:jar:1" end it 'should respect classifiers' do pom = JBundler::Pom.new("third", "1", ["jar \"org.jruby:jruby-core\", '~>1.7.0'", "pom \"f:g:jdk15\", \">1.2\", \"<=2.0\""]) File.read(pom.file).must_equal "4.0.0ruby.bundlerthird1org.jrubyjruby-core[1.7.0,1.7.99999]fg(1.2,2.0]pomjdk15" pom.coordinate.must_equal "ruby.bundler:third:jar:1" end end