You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by jd...@apache.org on 2025/07/05 19:27:05 UTC
(grails-core) 02/02: feedback: further code styling cleanup
This is an automated email from the ASF dual-hosted git repository.
jdaugherty pushed a commit to branch issue14193Cleanup
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 2cd640163f27ad23cb9118e1c25e1a6b8cc1e1b9
Author: James Daugherty <jd...@jdresources.net>
AuthorDate: Sat Jul 5 15:26:56 2025 -0400
feedback: further code styling cleanup
---
.../groovy/functionaltests/AsyncFunctionalSpec.groovy | 6 +++---
.../groovy/functionaltests/ControllerIncludesSpec.groovy | 12 ++++++------
.../groovy/functionaltests/ErrorsFunctionalSpec.groovy | 8 +++-----
.../groovy/functionaltests/MiscFunctionalSpec.groovy | 12 ++++++------
.../groovy/functionaltests/RedirectIntercetorSpec.groovy | 2 +-
.../integration-test/groovy/app2/ErrorsControllerSpec.groovy | 4 +---
.../com/demo/NotCachingControllerIntegrationSpec.groovy | 4 ++--
.../groovy/org/demo/spock/InheritedConfigSpec.groovy | 4 ++--
8 files changed, 24 insertions(+), 28 deletions(-)
diff --git a/grails-test-examples/app1/src/integration-test/groovy/functionaltests/AsyncFunctionalSpec.groovy b/grails-test-examples/app1/src/integration-test/groovy/functionaltests/AsyncFunctionalSpec.groovy
index 4bd988bf67..9db409059e 100644
--- a/grails-test-examples/app1/src/integration-test/groovy/functionaltests/AsyncFunctionalSpec.groovy
+++ b/grails-test-examples/app1/src/integration-test/groovy/functionaltests/AsyncFunctionalSpec.groovy
@@ -34,11 +34,11 @@ class AsyncFunctionalSpec extends ContainerGebSpec {
@PendingFeature(reason = 'pageSource == <html><head></head><body></body></html>')
void "Test async response rendering works"() {
- when:"When an async response is rendered"
+ when: "When an async response is rendered"
go('/async/test')
- then:"The rendered page is correct"
- pageSource.contains 'Hello'
+ then: "The rendered page is correct"
+ pageSource.contains('Hello')
}
}
diff --git a/grails-test-examples/app1/src/integration-test/groovy/functionaltests/ControllerIncludesSpec.groovy b/grails-test-examples/app1/src/integration-test/groovy/functionaltests/ControllerIncludesSpec.groovy
index 70c465e1cb..923f2ccbf5 100644
--- a/grails-test-examples/app1/src/integration-test/groovy/functionaltests/ControllerIncludesSpec.groovy
+++ b/grails-test-examples/app1/src/integration-test/groovy/functionaltests/ControllerIncludesSpec.groovy
@@ -33,7 +33,7 @@ class ControllerIncludesSpec extends ContainerGebSpec {
go('/includes/includeFromControllerActionRenderingView')
then: "Then the include worked"
- pageSource.contains 'Model is bar'
+ pageSource.contains('Model is bar')
}
void "Test includes that render text work when called from a controller action"() {
@@ -41,7 +41,7 @@ class ControllerIncludesSpec extends ContainerGebSpec {
go('/includes/includeFromControllerActionRenderingText')
then: "Then the include worked"
- pageSource.contains 'Test'
+ pageSource.contains('Test')
}
void "Test includes that render a view work when called from another view"() {
@@ -49,7 +49,7 @@ class ControllerIncludesSpec extends ContainerGebSpec {
go('/includes/includeFromViewRenderingView')
then: "Then the include worked"
- pageSource.trim().contains 'Include: \nModel is bar'
+ pageSource.trim().contains('Include: \nModel is bar')
}
void "Test includes that render text work when called from another view"() {
@@ -57,7 +57,7 @@ class ControllerIncludesSpec extends ContainerGebSpec {
go('/includes/includeFromViewRenderingText')
then: "Then the include worked"
- pageSource.contains 'Include: Test'
+ pageSource.contains('Include: Test')
}
void "Test includes that render a view work when called from a template"() {
@@ -65,7 +65,7 @@ class ControllerIncludesSpec extends ContainerGebSpec {
go('/includes/includeFromTemplateRenderingView')
then: "Then the include worked"
- pageSource.trim().contains 'Include: \nModel is bar'
+ pageSource.trim().contains('Include: \nModel is bar')
}
void "Test includes that render text work when called from a template"() {
@@ -73,7 +73,7 @@ class ControllerIncludesSpec extends ContainerGebSpec {
go('/includes/includeFromTemplateRenderingText')
then: "Then the include worked"
- pageSource.contains 'Include: Test'
+ pageSource.contains('Include: Test')
}
}
diff --git a/grails-test-examples/app1/src/integration-test/groovy/functionaltests/ErrorsFunctionalSpec.groovy b/grails-test-examples/app1/src/integration-test/groovy/functionaltests/ErrorsFunctionalSpec.groovy
index 8912132a35..ea5c082c1b 100644
--- a/grails-test-examples/app1/src/integration-test/groovy/functionaltests/ErrorsFunctionalSpec.groovy
+++ b/grails-test-examples/app1/src/integration-test/groovy/functionaltests/ErrorsFunctionalSpec.groovy
@@ -25,8 +25,6 @@ import grails.testing.mixin.integration.Integration
import spock.lang.Issue
import spock.lang.PendingFeature
-/**
- */
@Integration(applicationClass = Application)
@Rollback
class ErrorsFunctionalSpec extends ContainerGebSpec {
@@ -36,7 +34,7 @@ class ErrorsFunctionalSpec extends ContainerGebSpec {
go('/errors/throwCustomError')
then: "The correct action is executed"
- pageSource.contains 'Message = Something bad'
+ pageSource.contains('Message = Something bad')
}
void "Test 500 mappings for custom exceptions"() {
@@ -44,14 +42,14 @@ class ErrorsFunctionalSpec extends ContainerGebSpec {
go('/demo/throwCustomError')
then: "The correct action is executed"
- pageSource.contains 'Message = Something bad'
+ pageSource.contains('Message = Something bad')
}
void "Test default 500 mapping"() {
when: "An excetion that throws a general error handled by the default 500 mapping in UrlMapings.groovy"
go('/errors/throwGeneralError')
- println pageSource
+ println(pageSource)
then: "The title is correct"
$('ul', class: 'errors').text() == 'An error has occurred'
diff --git a/grails-test-examples/app1/src/integration-test/groovy/functionaltests/MiscFunctionalSpec.groovy b/grails-test-examples/app1/src/integration-test/groovy/functionaltests/MiscFunctionalSpec.groovy
index 104ce87fbf..a681742b01 100644
--- a/grails-test-examples/app1/src/integration-test/groovy/functionaltests/MiscFunctionalSpec.groovy
+++ b/grails-test-examples/app1/src/integration-test/groovy/functionaltests/MiscFunctionalSpec.groovy
@@ -32,8 +32,8 @@ class MiscFunctionalSpec extends ContainerGebSpec {
go('/misc/beanPropertyOverrideTest')
then:
- pageSource.contains 'Brian'
-
+ pageSource.contains('Brian'
+ )
}
@Issue('GRAILS-12028')
@@ -42,14 +42,14 @@ class MiscFunctionalSpec extends ContainerGebSpec {
go('/misc/actionWhichReturnsNull')
then:
- title == 'Action Which Returns Null GSP'
+ title == ('Action Which Returns Null GSP')
}
void "Test that placeholder configuration works for the config object"() {
- when:
+ when:
go('/misc/placeHolderConfig')
- then:
- pageSource.contains '[test test test]'
+ then:
+ pageSource.contains('[test test test]')
}
}
diff --git a/grails-test-examples/app1/src/integration-test/groovy/functionaltests/RedirectIntercetorSpec.groovy b/grails-test-examples/app1/src/integration-test/groovy/functionaltests/RedirectIntercetorSpec.groovy
index 4d426f1671..608e1460ff 100644
--- a/grails-test-examples/app1/src/integration-test/groovy/functionaltests/RedirectIntercetorSpec.groovy
+++ b/grails-test-examples/app1/src/integration-test/groovy/functionaltests/RedirectIntercetorSpec.groovy
@@ -33,6 +33,6 @@ class RedirectInterceptorSpec extends ContainerGebSpec {
go('/misc/interceptedByInterceptor')
then:
- pageSource.contains 'Test' // the redirect worked
+ pageSource.contains('Test') // the redirect worked
}
}
diff --git a/grails-test-examples/app2/src/integration-test/groovy/app2/ErrorsControllerSpec.groovy b/grails-test-examples/app2/src/integration-test/groovy/app2/ErrorsControllerSpec.groovy
index 7240f0a737..a234700b4c 100644
--- a/grails-test-examples/app2/src/integration-test/groovy/app2/ErrorsControllerSpec.groovy
+++ b/grails-test-examples/app2/src/integration-test/groovy/app2/ErrorsControllerSpec.groovy
@@ -23,8 +23,6 @@ import grails.gorm.transactions.Rollback
import grails.plugin.geb.ContainerGebSpec
import grails.testing.mixin.integration.Integration
-/**
- */
@Integration(applicationClass = Application)
@Rollback
class ErrorsControllerSpec extends ContainerGebSpec {
@@ -34,7 +32,7 @@ class ErrorsControllerSpec extends ContainerGebSpec {
go('/test/throwGeneralError')
then: "The correct action is executed"
- pageSource.contains 'my error occurred'
+ pageSource.contains('my error occurred')
}
}
diff --git a/grails-test-examples/cache/src/integration-test/groovy/com/demo/NotCachingControllerIntegrationSpec.groovy b/grails-test-examples/cache/src/integration-test/groovy/com/demo/NotCachingControllerIntegrationSpec.groovy
index 02486440b6..b439ba9856 100644
--- a/grails-test-examples/cache/src/integration-test/groovy/com/demo/NotCachingControllerIntegrationSpec.groovy
+++ b/grails-test-examples/cache/src/integration-test/groovy/com/demo/NotCachingControllerIntegrationSpec.groovy
@@ -30,12 +30,12 @@ class NotCachingControllerIntegrationSpec extends ContainerGebSpec {
go('/demo/show/1')
then:
- $().text().contains 'Hello World!1'
+ $().text().contains('Hello World!1')
when:
go('/demo/show/2')
then:
- $().text().contains 'Hello World!2'
+ $().text().contains('Hello World!2')
}
}
\ No newline at end of file
diff --git a/grails-test-examples/geb/src/integration-test/groovy/org/demo/spock/InheritedConfigSpec.groovy b/grails-test-examples/geb/src/integration-test/groovy/org/demo/spock/InheritedConfigSpec.groovy
index ab770d1737..970a6a6f9b 100644
--- a/grails-test-examples/geb/src/integration-test/groovy/org/demo/spock/InheritedConfigSpec.groovy
+++ b/grails-test-examples/geb/src/integration-test/groovy/org/demo/spock/InheritedConfigSpec.groovy
@@ -43,7 +43,7 @@ class NotSuperSpec extends ContainerGebSpec {}
class InheritedConfigSpec extends SuperSpec {
void 'should show the right server name when visiting /serverName'() {
when: 'visiting the server name controller'
- go(('/serverName'))
+ go('/serverName')
then: 'the emitted hostname is correct'
pageSource.contains('Server name: super.example.com')
@@ -67,7 +67,7 @@ class ChildPreferenceInheritedConfigSpec extends SuperSpec {
String hostName() {
return 'child.example.com'
}
-
+
void 'should show the right server name when visiting /serverName'() {
when: 'visiting the server name controller'
go('/serverName')