Skip to content

Commit

Permalink
Merge pull request #18 from ba-st/set-if-match-on-ZnClient
Browse files Browse the repository at this point in the history
Add `setIfMatchTo:` to `ZnClient`
  • Loading branch information
gcotelli committed Oct 7, 2019
2 parents 14602ad + 8843fb5 commit 8b1b37e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions source/Hyperspace-Model-Tests/ZnClientExtensionsTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,15 @@ ZnClientExtensionsTest >> testSetAccept [
client setAccept: ZnMimeType applicationPdf.
self assert: client request accept equals: ZnMimeType applicationPdf asString
]

{ #category : #tests }
ZnClientExtensionsTest >> testSetIfMatchTo [

| client |

client := ZnClient new.

self should: [ client request headers at: #'If-Match' ] raise: KeyNotFound.
client setIfMatchTo: ( ZnETag with: '12345' ).
self assert: ( client request headers at: #'If-Match' ) equals: '"12345"'
]
6 changes: 6 additions & 0 deletions source/Hyperspace-Model/ZnClient.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ ZnClient >> setAccept: object [

request setAccept: object
]

{ #category : #'*Hyperspace-Model' }
ZnClient >> setIfMatchTo: etag [

request setIfMatchTo: etag
]

0 comments on commit 8b1b37e

Please sign in to comment.