Added additional tests

This commit is contained in:
Marcin Grzejszczak
2018-03-15 16:43:32 +01:00
parent 08025963a8
commit 8fa57f5832

View File

@@ -36,16 +36,52 @@ class StubRunnerOptionsBuilderSpec extends Specification {
options.getDependencies().toString() == '[foo:bar:+:stubs]'
}
def shouldCreateDependenciesForCommaSeparatedStubs() {
def shouldCreateDependenciesForMultipleStubsWithSameGroup() {
given:
builder.withStubs('foo:bar,bar:foo')
builder.withStubs('foo:bar', 'foo:baz', 'foo:baz2')
when:
StubRunnerOptions options = builder.build()
then:
options.getDependencies().size() == 2
options.getDependencies().toString() == '[foo:bar:+:stubs, foo:baz:+:stubs, foo:baz2:+:stubs]'
}
def shouldCreateDependenciesForMultipleStubsWithSameArtifactId() {
given:
builder.withStubs('bar:foo', 'baz:foo', 'baz2:foo')
when:
StubRunnerOptions options = builder.build()
then:
options.getDependencies().toString() == '[bar:foo:+:stubs, baz:foo:+:stubs, baz2:foo:+:stubs]'
}
def shouldCreateDependenciesForCommaSeparatedStubs() {
given:
builder.withStubs('foo:bar,bar:foo,foo:baz')
when:
StubRunnerOptions options = builder.build()
then:
options.getDependencies().size() == 3
}
def shouldCreateDependenciesForCommaSeparatedStubsWithSameArtifact() {
given:
builder.withStubs('bar:foo,baz:foo,baz2:foo')
when:
StubRunnerOptions options = builder.build()
then:
options.getDependencies().toString() == '[bar:foo:+:stubs, baz:foo:+:stubs, baz2:foo:+:stubs]'
}
def shouldMapStubsWithPort() {