[squeak-dev] The Trunk: SUnit-pre.104.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jul 20 15:55:49 UTC 2016


Patrick Rein uploaded a new version of SUnit to project The Trunk:
http://source.squeak.org/trunk/SUnit-pre.104.mcz

==================== Summary ====================

Name: SUnit-pre.104
Author: pre
Time: 20 July 2016, 5:55:40.721797 pm
UUID: 41cb7db6-db89-c448-b0bb-5d74217a8bd6
Ancestors: SUnit-ul.103

Adds a new SUnit extension for tests which require an internet connection. This call should come at the beginning of the test to assert an internet connection and document any implicit dependence on network resources.

=============== Diff against SUnit-ul.103 ===============

Item was added:
+ ----- Method: SUnitExtensionsTest>>testEnsureInternetFails (in category 'test') -----
+ testEnsureInternetFails
+ 
+ 	self should: [self ensureInternetConnectionTo: ''] raise: Error!

Item was added:
+ ----- Method: TestCase>>ensureInternetConnection (in category 'extensions') -----
+ ensureInternetConnection
+ 
+ 	^ self ensureInternetConnectionTo: 'http://www.google.com'!

Item was added:
+ ----- Method: TestCase>>ensureInternetConnectionTo: (in category 'extensions') -----
+ ensureInternetConnectionTo: url 
+ 
+ 	"(Smalltalk classNamed: 'WebClient') httpGet: 'http://www.google.com'"
+ 	((Smalltalk classNamed: 'WebClient') httpGet: url) isSuccess
+ 		ifFalse: [Error signal: 'No internet connection available, but test requires one']
+ 		!

Item was added:
+ ----- Method: TestCase>>ensureSecureInternetConnection (in category 'extensions') -----
+ ensureSecureInternetConnection
+ 
+ 	^ self ensureConnectionTo: 'https://www.google.com'!



More information about the Squeak-dev mailing list