-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathpom_spec.rb
executable file
·96 lines (90 loc) · 3.34 KB
/
pom_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env jruby
# encoding: utf-8
require_relative "helper"
require "doubleshot/pom"
describe Doubleshot::Pom do
before do
@config = Doubleshot.new do |config|
config.project = "doubleshot"
config.group = "org.sam.doubleshot"
config.version = "1.0"
config.jar "org.jruby:jruby-complete:jar:1.7.0.RC1"
config.jar "org.sonatype.aether:aether-api:jar:1.13.1"
config.jar "org.sonatype.aether:aether-util:jar:1.13.1"
config.jar("org.sonatype.aether:aether-connector-wagon:1.13.1").exclude("org.sonatype.sisu:sisu-guice")
config.jar("testing:chaining-exclusions:jar:0.0.1").exclude("testing:exclusion-1").exclude("testing:exclusion-2")
config.gemspec do |spec|
spec.summary = "Build, Dependencies and Testing all in one!"
spec.description = "Description"
spec.author = "Sam Smoot"
spec.homepage = "https://github.com/sam/doubleshot"
spec.email = "ssmoot@gmail.com"
spec.license = "MIT-LICENSE"
spec.executables = [ "doubleshot" ]
end
end.config
end
it "must generate valid POM markup" do
Doubleshot::Pom.new(@config).to_s.must_equal <<-EOS.margin
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.sam.doubleshot</groupId>
<artifactId>doubleshot</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>doubleshot</name>
<dependencies>
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-complete</artifactId>
<type>jar</type>
<version>1.7.0.RC1</version>
</dependency>
<dependency>
<groupId>org.sonatype.aether</groupId>
<artifactId>aether-api</artifactId>
<type>jar</type>
<version>1.13.1</version>
</dependency>
<dependency>
<groupId>org.sonatype.aether</groupId>
<artifactId>aether-util</artifactId>
<type>jar</type>
<version>1.13.1</version>
</dependency>
<dependency>
<groupId>org.sonatype.aether</groupId>
<artifactId>aether-connector-wagon</artifactId>
<type>jar</type>
<version>1.13.1</version>
<exclusions>
<exclusion>
<groupId>org.sonatype.sisu</groupId>
<artifactId>sisu-guice</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>testing</groupId>
<artifactId>chaining-exclusions</artifactId>
<type>jar</type>
<version>0.0.1</version>
<exclusions>
<exclusion>
<groupId>testing</groupId>
<artifactId>exclusion-1</artifactId>
</exclusion>
<exclusion>
<groupId>testing</groupId>
<artifactId>exclusion-2</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
EOS
end
end