You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2012/05/16 20:50:32 UTC
[42/44] git commit: Convert TestNG to Spock
Convert TestNG to Spock
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/be704f1b
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/be704f1b
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/be704f1b
Branch: refs/heads/master
Commit: be704f1b2b62c95e46f94bef3145da0c462a0006
Parents: 52c219e
Author: Howard M. Lewis Ship <hl...@gmail.com>
Authored: Sun Apr 15 05:53:35 2012 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Wed May 16 11:49:40 2012 -0700
----------------------------------------------------------------------
.../apache/tapestry/ioc/BaseLocatableSpec.groovy | 35 ++++++++++
.../apache/tapestry5/ioc/BaseLocatableTest.java | 52 ---------------
2 files changed, 35 insertions(+), 52 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/be704f1b/tapestry-ioc/src/test/groovy/org/apache/tapestry/ioc/BaseLocatableSpec.groovy
----------------------------------------------------------------------
diff --git a/tapestry-ioc/src/test/groovy/org/apache/tapestry/ioc/BaseLocatableSpec.groovy b/tapestry-ioc/src/test/groovy/org/apache/tapestry/ioc/BaseLocatableSpec.groovy
new file mode 100644
index 0000000..21e60ab
--- /dev/null
+++ b/tapestry-ioc/src/test/groovy/org/apache/tapestry/ioc/BaseLocatableSpec.groovy
@@ -0,0 +1,35 @@
+package org.apache.tapestry.ioc
+
+import org.apache.tapestry5.ioc.BaseLocatable
+import org.apache.tapestry5.ioc.Locatable
+import org.apache.tapestry5.ioc.Location
+import spock.lang.Specification
+
+class LocatableFixture extends BaseLocatable {
+ LocatableFixture(Location location) {
+ super(location)
+ }
+}
+
+class BaseLocatableSpec extends Specification {
+
+ def "location property is readable"() {
+ Location location = Mock()
+
+ Locatable locatable = new LocatableFixture(location)
+
+ expect:
+
+ locatable.location.is location
+ }
+
+ def "location may be null"() {
+ Locatable locatable = new LocatableFixture(null);
+
+
+ expect:
+
+ locatable.location == null
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/be704f1b/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/BaseLocatableTest.java
----------------------------------------------------------------------
diff --git a/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/BaseLocatableTest.java b/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/BaseLocatableTest.java
deleted file mode 100644
index e77c68d..0000000
--- a/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/BaseLocatableTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package org.apache.tapestry5.ioc;
-
-import org.apache.tapestry5.ioc.test.IOCTestCase;
-import org.testng.annotations.Test;
-
-public class BaseLocatableTest extends IOCTestCase
-{
-
- static class LocatableFixture extends BaseLocatable
- {
- LocatableFixture(Location location)
- {
- super(location);
- }
- }
-
- @Test
- public void location_property_is_readable()
- {
- Location location = newMock(Location.class);
-
- replay();
-
- Locatable locatable = new LocatableFixture(location);
-
- verify();
-
- assertSame(locatable.getLocation(), location);
- }
-
- @Test
- public void null_is_allowed_for_location()
- {
- Locatable locatable = new LocatableFixture(null);
-
- assertNull(locatable.getLocation());
- }
-}