-
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.
feat: log failed status code assertion
- Loading branch information
Showing
2 changed files
with
45 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
prefix : <https://api-tuner.described.at/test#http-code/> | ||
PREFIX earl: <http://www.w3.org/ns/earl#> | ||
PREFIX tuner: <https://api-tuner.described.at/> | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX log: <http://www.w3.org/2000/10/swap/log#> | ||
PREFIX string: <http://www.w3.org/2000/10/swap/string#> | ||
|
||
: | ||
a earl:TestCase ; | ||
rdfs:label "Test assertion on status code" ; | ||
. | ||
|
||
# Configure a request | ||
:req | ||
a tuner:Request ; | ||
tuner:url <http://localhost:1080/example.com> ; | ||
tuner:method "GET" ; | ||
. | ||
|
||
{ | ||
:req tuner:response ?res . | ||
|
||
?res tuner:http_code 200 . | ||
|
||
( | ||
{ ?res tuner:http_code 201 } | ||
{ | ||
"Expected assertion failure"^tuner:info . | ||
true log:equalTo false . | ||
} | ||
true | ||
) log:ifThenElseIn ?SCOPE . | ||
} => { | ||
: earl:outcome earl:passed . | ||
} . |