-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from ba-st/minor_improvements
Introduce generic set header command
- Loading branch information
Showing
5 changed files
with
65 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
...etAuthorizationHeaderCommandTest.class.st → ...Model-Tests/SetHeaderCommandTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
Class { | ||
#name : #SetAuthorizationHeaderCommandTest, | ||
#name : #SetHeaderCommandTest, | ||
#superclass : #TestCase, | ||
#category : #'Superluminal-Model-Tests-Commands' | ||
} | ||
|
||
{ #category : #tests } | ||
SetAuthorizationHeaderCommandTest >> testApplyOn [ | ||
SetHeaderCommandTest >> testApplyOn [ | ||
|
||
| httpClient command | | ||
|
||
httpClient := ZnClient new. | ||
command := SetAuthorizationHeaderCommand toBearerToken: 'token'. | ||
command := SetHeaderCommand settingAuthorizationToBearerToken: 'token'. | ||
command applyOn: httpClient. | ||
|
||
self assert: ( httpClient request headers at: #Authorization ) equals: 'Bearer ''token''' | ||
] | ||
|
||
{ #category : #tests } | ||
SetAuthorizationHeaderCommandTest >> testCannotUseAnEmptyValue [ | ||
SetHeaderCommandTest >> testCannotUseAnEmptyValue [ | ||
|
||
self | ||
should: [ SetAuthorizationHeaderCommand to: '' ] | ||
should: [ SetHeaderCommand settingAuthorizationTo: '' ] | ||
raise: InstanceCreationFailed | ||
withMessageText: 'An Authorization header cannot include empty directives.' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters