Skip to content

Commit b54af37

Browse files
author
Matthieu Coudron
committed
test the import of a file from var < {{FILENAME}}
1 parent ef06dae commit b54af37

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

lua/rest-nvim/request/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ local function get_importfile_name(bufnr, start_line, stop_line)
1818
if import_line > 0 then
1919
local fileimport_string
2020
local fileimport_line
21+
local fileimport_spliced
2122
fileimport_line = vim.api.nvim_buf_get_lines(bufnr, import_line - 1, import_line, false)
2223
fileimport_string = string.gsub(fileimport_line[1], "<", "", 1)
2324
:gsub("^%s+", "")

tests/env_vars/.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
URL=https://reqres.in/api/users
22
USERNAME=morpheus
33
TOKEN=emacs-is-pinky-stop-using-it
4+
5+
PAYLOAD=user.json

tests/env_vars/post_create_user.http

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@ Authorization: Bearer {{TOKEN}}
1515
"job": "leader",
1616
"id" : "{{$uuid}}"
1717
}
18+
19+
----
20+
21+
POST {{URL}}
22+
Content-Type: application/json
23+
Authorization: Bearer {{TOKEN}}
24+
25+
< {{PAYLOAD]}}

tests/env_vars/user.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
{
3+
"name": "toto",
4+
"job": "leader",
5+
"id" : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
6+
}

0 commit comments

Comments
 (0)