add tags for rspec via system properties
This commit is contained in:
parent
5ff567efb6
commit
41abec8cb9
|
@ -61,10 +61,17 @@ class RSpec extends DefaultTask {
|
|||
if (pattern != null) {
|
||||
args += ['--pattern', pattern]
|
||||
}
|
||||
|
||||
String tags = System.getProperty("${name}.tags")
|
||||
if (tags != null) {
|
||||
tags.split(/\s+/).each { args += ['--tags', it] }
|
||||
}
|
||||
|
||||
String file = System.getProperty("${name}.file")
|
||||
if (file != null) {
|
||||
args += [file]
|
||||
}
|
||||
|
||||
jruby.exec(args)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -286,4 +286,17 @@ class JRubyRSpecPluginSpec extends Specification {
|
|||
then:
|
||||
thrown(ExecException)
|
||||
}
|
||||
|
||||
def "Run rspec with unknown tag"() {
|
||||
given:
|
||||
Files.createSymbolicLink(specDir.toPath(), new File('src/test/resources/simple/spec').getAbsoluteFile().toPath())
|
||||
project.evaluate()
|
||||
System.setProperty('rspec.tags', 'me-and-the-corner:today')
|
||||
Task task = project.tasks.getByName('rspec')
|
||||
String output = captureStdout {
|
||||
task.run()
|
||||
}
|
||||
expect:
|
||||
output.contains( '4 examples, 0 failures' )
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue