1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- Class {
- #name : #Znock,
- #superclass : #Object,
- #instVars : [
- 'expectations'
- ],
- #classInstVars : [
- 'default'
- ],
- #category : #Znock
- }
- { #category : #accessing }
- Znock class >> default [
- ^ default ifNil: [ default := self new ]
- ]
- { #category : #accessing }
- Znock >> addExpectation: aZnClient [
- ^ self expectations add: aZnClient
- ]
- { #category : #public }
- Znock >> baseFor: descriptor [
- ^ ZnockBase in: self url: descriptor asHostFirstUrl
- ]
- { #category : #operations }
- Znock >> consumeExpectationFor: aZnockClient [
- ^ self expectations
- detect: [ :one | aZnockClient matches: one ]
- ifFound: [ :one | expectations remove: one. one ]
- ifNone: [ nil ]
- ]
- { #category : #accessing }
- Znock >> expectations [
- ^ expectations ifNil: [ expectations := OrderedCollection new ]
- ]
- { #category : #public }
- Znock >> pendingExpectations [
- ^ self expectations copy.
- ]
- { #category : #public }
- Znock >> removeAll [
- self expectations removeAll
- ]
|