[DOCS] Remove support for // CONSOLE magic comment (#46936) (#47110)

#46180 added support for the `[source,console]`
language for snippets which should be tested.

This removes support for the `// CONSOLE` magic comment,
which serve a similar purpose.

Snippets that include the `// CONSOLE` magic comment will return
an exception.
This commit is contained in:
James Rodewig 2019-09-25 12:35:48 -04:00 committed by GitHub
parent d5f396fe55
commit 365aa30b7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -206,8 +206,11 @@ public class RestTestsFromSnippetsTask extends SnippetsTask {
response(snippet)
return
}
if (snippet.test || snippet.console ||
snippet.language == 'console') {
if ((snippet.language == 'js') && (snippet.console)) {
throw new InvalidUserDataException(
"$snippet: Use `[source,console]` instead of `// CONSOLE`.")
}
if (snippet.test || snippet.language == 'console') {
test(snippet)
previousTest = snippet
return