Herby Vojčík 6 лет назад
Родитель
Сommit
ee778b3528

+ 7 - 0
src/Znock-Mocketry/Znock.extension.st

@@ -0,0 +1,7 @@
+Extension { #name : #Znock }
+
+{ #category : #'*Znock-Mocketry' }
+Znock >> intercept [
+
+	ZnClient stub new will: [ ZnockClient newWithInterceptor: self ]
+]

+ 1 - 0
src/Znock-Mocketry/package.st

@@ -0,0 +1 @@
+Package { #name : #Znock-Mocketry }

+ 14 - 0
src/Znock/Znock.class.st

@@ -0,0 +1,14 @@
+Class {
+	#name : #Znock,
+	#superclass : #ZnClient,
+	#classInstVars : [
+		'default'
+	],
+	#category : #Znock
+}
+
+{ #category : #accessing }
+Znock class >> default [
+
+	^ default ifNil: [ default := self new ]
+]

+ 12 - 0
src/Znock/ZnockClient.class.st

@@ -0,0 +1,12 @@
+Class {
+	#name : #ZnockClient,
+	#superclass : #ZnClient,
+	#category : #Znock
+}
+
+{ #category : #'private protocol' }
+ZnockClient >> executeRequestResponse [
+	^ false
+		ifTrue: [ response := ZnResponse badRequest: self request. response contents ]
+		ifFalse: [ super executeRequestResponse ]
+]

+ 1 - 0
src/Znock/package.st

@@ -0,0 +1 @@
+Package { #name : #Znock }