groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject incubator-groovy git commit: testfile() now deletes temporary files it creates
Date Sat, 26 Sep 2015 10:04:31 GMT
Repository: incubator-groovy
Updated Branches:
  refs/heads/master c548e7d02 -> 2ce5721b4


testfile() now deletes temporary files it creates


Project: http://git-wip-us.apache.org/repos/asf/incubator-groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-groovy/commit/2ce5721b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/2ce5721b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/2ce5721b

Branch: refs/heads/master
Commit: 2ce5721b4cb8c60748fec5d9c659e79a9b0e415f
Parents: c548e7d
Author: pascalschumacher <pascalschumacher@gmx.net>
Authored: Sat Sep 26 12:04:13 2015 +0200
Committer: pascalschumacher <pascalschumacher@gmx.net>
Committed: Sat Sep 26 12:04:13 2015 +0200

----------------------------------------------------------------------
 .../src/test/groovy/groovy/json/JsonOutputTest.groovy         | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/2ce5721b/subprojects/groovy-json/src/test/groovy/groovy/json/JsonOutputTest.groovy
----------------------------------------------------------------------
diff --git a/subprojects/groovy-json/src/test/groovy/groovy/json/JsonOutputTest.groovy b/subprojects/groovy-json/src/test/groovy/groovy/json/JsonOutputTest.groovy
index 4c4efb6..1ac5831 100644
--- a/subprojects/groovy-json/src/test/groovy/groovy/json/JsonOutputTest.groovy
+++ b/subprojects/groovy-json/src/test/groovy/groovy/json/JsonOutputTest.groovy
@@ -417,16 +417,19 @@ class JsonOutputTest extends GroovyTestCase {
     }
 
     void testFile() {
-        def file  = File.createTempFile('test', 'file-json')
         def unusedProp = ['class', 'metaclass', 'declaringClass', 'canonicalFile', 'absoluteFile',
'parentFile']
         def removeUnused = { map -> unusedProp.each { map.remove(it)}; map }
 
+        def file  = File.createTempFile('test', 'file-json')
+        file.deleteOnExit()
         assert toJson(file) == toJson(removeUnused(file.properties))
+
         def dir = File.createTempDir()
+        dir.deleteOnExit()
         assert toJson(dir) == toJson(removeUnused(dir.properties))
 
         def objectWithFile = new JsonEmbeddedFile(name: 'testFile', file: file)
-        assert toJson(objectWithFile) == "{\"file\":${toJson(file)},\"name\":\"testFile\"}".toString()
+        assert toJson(objectWithFile) == "{\"file\":${toJson(file)},\"name\":\"testFile\"}"
     }
 
 }


Mime
View raw message