Skip to content

Commit

Permalink
Merge pull request #66 from ba-st/improve_tests
Browse files Browse the repository at this point in the history
Use Launchpad testing affordances
  • Loading branch information
gcotelli authored Apr 22, 2024
2 parents 8732064 + ea41d53 commit a5c2c34
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 27 deletions.
5 changes: 3 additions & 2 deletions source/BaselineOfSuperluminal/BaselineOfSuperluminal.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ BaselineOfSuperluminal >> setUpDependencies: spec [

spec
baseline: 'Launchpad' with: [ spec repository: 'github://ba-st/Launchpad:v5' ];
project: 'Launchpad-Deployment' copyFrom: 'Launchpad' with: [ spec loads: 'Deployment' ].
project: 'Launchpad-Deployment' copyFrom: 'Launchpad' with: [ spec loads: 'Deployment' ];
project: 'Launchpad-SUnit' copyFrom: 'Launchpad' with: [ spec loads: 'Dependent-SUnit-Extensions' ].

spec
baseline: 'NeoJSON' with: [ spec repository: 'github://svenvc/NeoJSON:master' ];
Expand Down Expand Up @@ -128,6 +129,6 @@ BaselineOfSuperluminal >> setUpTestPackages: spec [
group: 'Tests' with: 'Superluminal-Service-Discovery-Tests'.
spec
package: 'Superluminal-Service-Discovery-Examples-Tests'
with: [ spec requires: 'Superluminal-Service-Discovery-Examples' ];
with: [ spec requires: #('Superluminal-Service-Discovery-Examples' 'Launchpad-SUnit')];
group: 'Tests' with: 'Superluminal-Service-Discovery-Examples-Tests'
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,52 @@
A SuperluminalServiceDiscoveryExampleLauncherTest is a test class for testing the behavior of SuperluminalServiceDiscoveryExampleLauncher
"
Class {
#name : #SuperluminalServiceDiscoveryExampleLauncherTest,
#superclass : #TestCase,
#category : #'Superluminal-Service-Discovery-Examples-Tests'
#name : 'SuperluminalServiceDiscoveryExampleLauncherTest',
#superclass : 'TestCase',
#category : 'Superluminal-Service-Discovery-Examples-Tests',
#package : 'Superluminal-Service-Discovery-Examples-Tests'
}

{ #category : #tests }
{ #category : 'tests' }
SuperluminalServiceDiscoveryExampleLauncherTest >> testActivate [

| commandLine |

commandLine := CommandLineArguments withArguments:
#( 'launchpad' 'start' '--debug-mode' 'superluminal-service-discovery'
'--consul-agent-location=http://consul:8500'
'--message=Hello' '--retry-delay-in-ms=1' ).

self should: [ LaunchpadCommandLineHandler activateWith: commandLine ] raise: HTTPError
self
should: [
LaunchpadCommandLineHandler activateWithArguments:
#( 'launchpad' 'start' '--debug-mode' 'superluminal-service-discovery'
'--consul-agent-location=http://consul:8500' '--message=Hello' '--retry-delay-in-ms=1' )
]
raise: HTTPError
]

{ #category : #tests }
{ #category : 'tests' }
SuperluminalServiceDiscoveryExampleLauncherTest >> testActivateInReleaseMode [

| commandLine |

commandLine := CommandLineArguments withArguments:
#( 'launchpad' 'start' 'superluminal-service-discovery'
'--consul-agent-location=http://consul:8500'
'--message=Hello' '--retry-delay-in-ms=1' ).

self should: [ LaunchpadCommandLineHandler activateWith: commandLine ]
self
should: [
LaunchpadCommandLineHandler activateWithArguments:
#( 'launchpad' 'start' 'superluminal-service-discovery' '--consul-agent-location=http://consul:8500'
'--message=Hello' '--retry-delay-in-ms=1' )
]
raise: Exit
withExceptionDo: [ :exit | self deny: exit isSuccess ]
]

{ #category : #tests }
{ #category : 'tests' }
SuperluminalServiceDiscoveryExampleLauncherTest >> testCommandName [

self assert: SuperluminalServiceDiscoveryExample commandName
equals: 'superluminal-service-discovery'
]

{ #category : #tests }
{ #category : 'tests' }
SuperluminalServiceDiscoveryExampleLauncherTest >> testDescription [

self assert: SuperluminalServiceDiscoveryExample description
equals: 'I''m a command line example using as dependency an echo API'
]

{ #category : #tests }
{ #category : 'tests' }
SuperluminalServiceDiscoveryExampleLauncherTest >> testHelp [

self assert:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #'Superluminal-Service-Discovery-Examples-Tests' }
Package { #name : 'Superluminal-Service-Discovery-Examples-Tests' }

0 comments on commit a5c2c34

Please sign in to comment.