This is an automated email from the ASF dual-hosted git repository.
jonnybot pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy-geb.git
The following commit(s) were added to refs/heads/master by this push:
new 4124f12c Fix some codenarc errors
4124f12c is described below
commit 4124f12c5dbae77c801130d719e567aa6fcfec42
Author: Jonny Carter <[email protected]>
AuthorDate: Mon Dec 23 10:26:33 2024 -0600
Fix some codenarc errors
---
.../groovy/assertions/ImplicitAssertionsSpec.groovy | 8 ++++----
.../src/test/groovy/browser/WithNewWindowSpec.groovy | 2 +-
.../src/test/groovy/ide/StrongTypingSpec.groovy | 6 +++---
.../groovy/modules/UnwrappingModulesSnippetSpec.groovy | 18 +++++++++---------
.../src/test/groovy/pages/LifecycleHooksSpec.groovy | 8 ++++----
.../src/test/groovy/pages/UnexpectedPagesSpec.groovy | 4 ++--
.../test/groovy/testing/ReportingFunctionalSpec.groovy | 10 +++++-----
7 files changed, 28 insertions(+), 28 deletions(-)
diff --git
a/doc/manual-snippets/src/test/groovy/assertions/ImplicitAssertionsSpec.groovy
b/doc/manual-snippets/src/test/groovy/assertions/ImplicitAssertionsSpec.groovy
index bdd36492..abd9fc74 100644
---
a/doc/manual-snippets/src/test/groovy/assertions/ImplicitAssertionsSpec.groovy
+++
b/doc/manual-snippets/src/test/groovy/assertions/ImplicitAssertionsSpec.groovy
@@ -127,9 +127,9 @@ title == "Page Title"
when:
config.rawConfig.waiting.timeout = 0.1
- //tag::waiting[]
+ // tag::waiting[]
waitFor { title == "Page Title" }
- //end::waiting[]
+ // end::waiting[]
then:
WaitTimeoutException e = thrown()
@@ -138,12 +138,12 @@ title == "Page Title"
def "selectively disabling implicit assertions"() {
when:
- //tag::disable_implicit_assertions[]
+ // tag::disable_implicit_assertions[]
waitFor(implicitAssertions: false) {
falseReturningMethod()
true
}
- //end::disable_implicit_assertions[]
+ // end::disable_implicit_assertions[]
then:
noExceptionThrown()
diff --git
a/doc/manual-snippets/src/test/groovy/browser/WithNewWindowSpec.groovy
b/doc/manual-snippets/src/test/groovy/browser/WithNewWindowSpec.groovy
index 4249936d..d0507396 100644
--- a/doc/manual-snippets/src/test/groovy/browser/WithNewWindowSpec.groovy
+++ b/doc/manual-snippets/src/test/groovy/browser/WithNewWindowSpec.groovy
@@ -67,7 +67,7 @@ class WithNewWindowSpec extends
DriveMethodSupportingSpecWithServer {
go()
withNewWindow({ js.openNewWindow() }, wait: true) {
// end::new_window_with_wait[]
- waitFor { title } //loading the page in a new window is not a
blocking operation?
+ waitFor { title } // loading the page in a new window is not a
blocking operation?
// tag::new_window_with_wait[]
assert title == 'Google'
}
diff --git a/doc/manual-snippets/src/test/groovy/ide/StrongTypingSpec.groovy
b/doc/manual-snippets/src/test/groovy/ide/StrongTypingSpec.groovy
index 7f5f308f..848c9724 100644
--- a/doc/manual-snippets/src/test/groovy/ide/StrongTypingSpec.groovy
+++ b/doc/manual-snippets/src/test/groovy/ide/StrongTypingSpec.groovy
@@ -149,7 +149,7 @@ class SecurePage extends Page {
// end::pages[]
class AsyncPage extends Page {
- //tag::types_with_content[]
+ // tag::types_with_content[]
static content = {
async(wait: true) { $("#async") }
}
@@ -157,5 +157,5 @@ class AsyncPage extends Page {
String asyncText() {
async.text() //<1>
}
- //end::types_with_content[]
-}
\ No newline at end of file
+ // end::types_with_content[]
+}
diff --git
a/doc/manual-snippets/src/test/groovy/modules/UnwrappingModulesSnippetSpec.groovy
b/doc/manual-snippets/src/test/groovy/modules/UnwrappingModulesSnippetSpec.groovy
index a8122bd6..a11f0d4c 100644
---
a/doc/manual-snippets/src/test/groovy/modules/UnwrappingModulesSnippetSpec.groovy
+++
b/doc/manual-snippets/src/test/groovy/modules/UnwrappingModulesSnippetSpec.groovy
@@ -35,24 +35,24 @@ class UnwrappingModulesSnippetSpec extends
DriveMethodSupportingSpecWithServer {
@SuppressWarnings('UnusedVariable')
def "assignment of a module to a variable of its declared type fails"() {
when:
- //tag::module_variable_fail[]
+ // tag::module_variable_fail[]
Browser.drive {
to ModuleUnwrappingPage
UnwrappedModule foo = theModule // <1>
}
- //end::module_variable_fail[]
+ // end::module_variable_fail[]
then:
thrown(GroovyCastException)
}
def "method invocation with an argument of module's declared type fails"()
{
when:
- //tag::module_argument_fail[]
+ // tag::module_argument_fail[]
Browser.drive {
to ModuleUnwrappingPage
getContentText(theModule) // <1>
}
- //end::module_argument_fail[]
+ // end::module_argument_fail[]
then:
thrown(MissingMethodException)
}
@@ -60,22 +60,22 @@ class UnwrappingModulesSnippetSpec extends
DriveMethodSupportingSpecWithServer {
@SuppressWarnings('UnusedVariable')
def "unwrapped module may be used with its declared type"() {
when:
- //tag::module_cast[]
+ // tag::module_cast[]
Browser.drive {
to ModuleUnwrappingPage
UnwrappedModule unwrapped = theModule as UnwrappedModule
getContentText(theModule as UnwrappedModule)
}
- //end::module_cast[]
+ // end::module_cast[]
then:
noExceptionThrown()
}
- //tag::module_argument_fail_method[]
+ // tag::module_argument_fail_method[]
String getContentText(UnwrappedModule module) {
module.theContent.text()
}
- //end::module_argument_fail_method[]
+ // end::module_argument_fail_method[]
}
// tag::page[]
@@ -92,4 +92,4 @@ class UnwrappedModule extends Module {
theContent { $(".the-content") }
}
}
-// end::module[]
\ No newline at end of file
+// end::module[]
diff --git
a/doc/manual-snippets/src/test/groovy/pages/LifecycleHooksSpec.groovy
b/doc/manual-snippets/src/test/groovy/pages/LifecycleHooksSpec.groovy
index 627e0d79..e03b4693 100644
--- a/doc/manual-snippets/src/test/groovy/pages/LifecycleHooksSpec.groovy
+++ b/doc/manual-snippets/src/test/groovy/pages/LifecycleHooksSpec.groovy
@@ -26,24 +26,24 @@ class LifecycleHooksSpec extends
DriveMethodSupportingSpecWithServer {
def "on load"() {
expect:
- //tag::on_load[]
+ // tag::on_load[]
Browser.drive {
to FirstPage
to SecondPage
assert page.previousPageName == "FirstPage"
}
- //end::on_load[]
+ // end::on_load[]
}
def "on unload"() {
expect:
- //tag::on_unload[]
+ // tag::on_unload[]
Browser.drive {
def firstPage = to FirstPage
to SecondPage
assert firstPage.newPageName == "SecondPage"
}
- //end::on_unload[]
+ // end::on_unload[]
}
}
diff --git
a/doc/manual-snippets/src/test/groovy/pages/UnexpectedPagesSpec.groovy
b/doc/manual-snippets/src/test/groovy/pages/UnexpectedPagesSpec.groovy
index aae5e8b9..cef6227c 100644
--- a/doc/manual-snippets/src/test/groovy/pages/UnexpectedPagesSpec.groovy
+++ b/doc/manual-snippets/src/test/groovy/pages/UnexpectedPagesSpec.groovy
@@ -54,7 +54,7 @@ class UnexpectedPagesSpec extends GebSpecWithCallbackServer {
// tag::usage[]
try {
at ExpectedPage
- assert false //should not get here
+ assert false // should not get here
} catch (UnexpectedPageException e) {
assert e.message.startsWith("An unexpected page
${PageNotFoundPage.name} was encountered")
}
@@ -83,7 +83,7 @@ class UnexpectedPagesSpec extends GebSpecWithCallbackServer {
// tag::usage_with_custom_message[]
try {
at ExpectedPage
- assert false //should not get here
+ assert false // should not get here
} catch (UnexpectedPageException e) {
assert e.message.contains("Additional UnexpectedPageException
message text")
}
diff --git
a/doc/manual-snippets/src/test/groovy/testing/ReportingFunctionalSpec.groovy
b/doc/manual-snippets/src/test/groovy/testing/ReportingFunctionalSpec.groovy
index d05957e0..a7e81931 100644
--- a/doc/manual-snippets/src/test/groovy/testing/ReportingFunctionalSpec.groovy
+++ b/doc/manual-snippets/src/test/groovy/testing/ReportingFunctionalSpec.groovy
@@ -60,13 +60,13 @@ class ReportingFunctionalSpec extends Specification {
def "reporting on a failing test which also writes a custom report"() {
when:
specRunner.runWithImports """
- //tag::example[]
+ // tag::example[]
import geb.spock.GebReportingSpec
import geb.spock.SpockGebTestManagerBuilder
import geb.test.GebTestManager
class LoginSpec extends GebReportingSpec {
- //end::example[]
+ // end::example[]
private final static GebTestManager TEST_MANAGER = new
SpockGebTestManagerBuilder()
.withReportingEnabled(true)
@@ -81,19 +81,19 @@ class ReportingFunctionalSpec extends Specification {
config.rawConfig.reportsDir =
"${reportsDir.absolutePath.replaceAll("\\\\", "\\\\\\\\")}"
}
- //tag::example[]
+ // tag::example[]
def "login"() {
when:
go "/login"
username = "me"
- report "login screen" //<1>
+ report "login screen" // <1>
login().click()
then:
title == "Logged in!"
}
}
- //end::example[]
+ // end::example[]
"""
then: