Sha256: 65e64ef56d6dafa26a43fffd0081bf15eda9c2cf41d412036293fd3b931fa727

Contents?: true

Size: 1.3 KB

Versions: 6

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

require 'lock_jar/domain/dsl_merger'

describe LockJar::Domain::DslMerger do
  it 'should merge dsl' do
    block1 = LockJar::Domain::Dsl.create do
      repository 'http://repository.jboss.org/nexus/content/groups/public-jboss'

      jar 'org.apache.mina:mina-core:2.0.4'
      pom 'spec/pom.xml'

      group 'runtime' do
        jar 'org.apache.tomcat:servlet-api:jar:6.0.35'
      end

      group 'test' do
        jar 'junit:junit:jar:4.10'
      end
    end

    block2 = LockJar::Domain::Dsl.create do
      repository 'http://repository.jboss.org/nexus/content/groups/public-jboss'
      repository 'http://new-repo'

      jar 'org.apache.mina:mina-core:2.0.4'
      jar 'compile-jar'

      group 'runtime' do
        jar 'runtime-jar'
        pom 'runtime-pom.xml'
      end

      group 'test' do
        jar 'test-jar'
        pom 'test-pom.xml'
      end
    end

    dsl = LockJar::Domain::DslMerger.new(block1, block2).merge

    expect(dsl.artifacts['default']).to eq([
      LockJar::Domain::Jar.new('org.apache.mina:mina-core:2.0.4'),
      LockJar::Domain::Pom.new('spec/pom.xml', %w(runtime compile)),
      LockJar::Domain::Jar.new('compile-jar')
    ])
    dsl.remote_repositories.should eql(['http://repository.jboss.org/nexus/content/groups/public-jboss', 'http://new-repo'])
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lock_jar-0.14.5 spec/lock_jar/domain/dsl_merger_spec.rb
lock_jar-0.14.4 spec/lock_jar/domain/dsl_merger_spec.rb
lock_jar-0.14.3 spec/lock_jar/domain/dsl_merger_spec.rb
lock_jar-0.14.2 spec/lock_jar/domain/dsl_merger_spec.rb
lock_jar-0.14.1 spec/lock_jar/domain/dsl_merger_spec.rb
lock_jar-0.14.0 spec/lock_jar/domain/dsl_merger_spec.rb