forked from freenet-public/got-swag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
yoda.yaml
36 lines (32 loc) · 1.21 KB
/
yoda.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Basic example
# got-swag examples/yoda.yaml examples/vars.yaml -t 5000
x-tests:
- description: Check if Yoda is alive
steps:
- auth( 'mashape', vars.auth.mashape )
- get( 'https://yoda.p.mashape.com/yoda?sentence=Hello' )
- equal( res.statusCode, 200 )
- description: Check if it's really Yoda
cases:
- text: You will learn how to speak like me someday. Oh wait.
pattern: Learn how to speak like me someday, you will.
- text: You have much to learn, my very young padawan.
pattern: Much to learn, you have
- text: |
Death is a natural part of life.
Rejoice for those around you who transform into the Force.
Do not mourn them.
Do not miss them.
Attachment leads to jealously.
That is the shadow of greed.
pattern: The shadow of greed,? that is.
steps:
- auth( 'mashape', vars.auth.mashape )
- get( 'https://yoda.p.mashape.com/yoda?sentence=' + encodeURIComponent( data.text ) )
- match( res.body, new RegExp( data.pattern ) )
- log( res.body )
securityDefinitions:
mashape:
type: apiKey
in: header
name: X-Mashape-Key