diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2022-02-16 22:15:28 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2022-02-17 12:47:25 -0300 |
commit | 6c524b4a1b9fec2fe4abf03fa83b8d6624c23e26 (patch) | |
tree | e288246223281604d5dfdc8471e05f9389c2984a /spec/fetch_spec.lua | |
parent | d1d4694d3f216030cc9653d95963a30f287f2247 (diff) | |
download | luarocks-6c524b4a1b9fec2fe4abf03fa83b8d6624c23e26.tar.gz luarocks-6c524b4a1b9fec2fe4abf03fa83b8d6624c23e26.tar.bz2 luarocks-6c524b4a1b9fec2fe4abf03fa83b8d6624c23e26.zip |
tests: wait longer for mock server to start
Diffstat (limited to 'spec/fetch_spec.lua')
-rw-r--r-- | spec/fetch_spec.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/fetch_spec.lua b/spec/fetch_spec.lua index 008a91c8..0087159b 100644 --- a/spec/fetch_spec.lua +++ b/spec/fetch_spec.lua | |||
@@ -39,7 +39,8 @@ describe("luarocks fetch #unit #mock", function() | |||
39 | describe("fetch.fetch_url", function() | 39 | describe("fetch.fetch_url", function() |
40 | 40 | ||
41 | it("fetches the url argument and returns the absolute path of the fetched file", function() | 41 | it("fetches the url argument and returns the absolute path of the fetched file", function() |
42 | local fetchedfile = fetch.fetch_url("http://localhost:8080/file/a_rock.lua") | 42 | local fetchedfile, err = fetch.fetch_url("http://localhost:8080/file/a_rock.lua") |
43 | assert(fetchedfile, err) | ||
43 | assert.truthy(are_same_files(fetchedfile, lfs.currentdir() .. "/a_rock.lua")) | 44 | assert.truthy(are_same_files(fetchedfile, lfs.currentdir() .. "/a_rock.lua")) |
44 | local fd = assert(io.open(fetchedfile, "r")) | 45 | local fd = assert(io.open(fetchedfile, "r")) |
45 | local fetchedcontent = assert(fd:read("*a")) | 46 | local fetchedcontent = assert(fd:read("*a")) |
@@ -109,6 +110,7 @@ describe("luarocks fetch #unit #mock", function() | |||
109 | 110 | ||
110 | it("returns true and fetches the url into a temporary dir", function() | 111 | it("returns true and fetches the url into a temporary dir", function() |
111 | local fetchedfile, tmpdir = fetch.fetch_url_at_temp_dir("http://localhost:8080/file/a_rock.lua", "test") | 112 | local fetchedfile, tmpdir = fetch.fetch_url_at_temp_dir("http://localhost:8080/file/a_rock.lua", "test") |
113 | assert(fetchedfile, tmpdir) | ||
112 | assert.truthy(are_same_files(fetchedfile, tmpdir .. "/a_rock.lua")) | 114 | assert.truthy(are_same_files(fetchedfile, tmpdir .. "/a_rock.lua")) |
113 | local fd = assert(io.open(fetchedfile, "r")) | 115 | local fd = assert(io.open(fetchedfile, "r")) |
114 | local fetchedcontent = assert(fd:read("*a")) | 116 | local fetchedcontent = assert(fd:read("*a")) |
@@ -121,6 +123,7 @@ describe("luarocks fetch #unit #mock", function() | |||
121 | 123 | ||
122 | it("returns true and fetches the url into a temporary dir with custom filename", function() | 124 | it("returns true and fetches the url into a temporary dir with custom filename", function() |
123 | local fetchedfile, tmpdir = fetch.fetch_url_at_temp_dir("http://localhost:8080/file/a_rock.lua", "test", "my_a_rock.lua") | 125 | local fetchedfile, tmpdir = fetch.fetch_url_at_temp_dir("http://localhost:8080/file/a_rock.lua", "test", "my_a_rock.lua") |
126 | assert(fetchedfile, tmpdir) | ||
124 | assert.truthy(are_same_files(fetchedfile, tmpdir .. "/my_a_rock.lua")) | 127 | assert.truthy(are_same_files(fetchedfile, tmpdir .. "/my_a_rock.lua")) |
125 | assert.truthy(string.find(tmpdir, "test")) | 128 | assert.truthy(string.find(tmpdir, "test")) |
126 | local fd = assert(io.open(fetchedfile, "r")) | 129 | local fd = assert(io.open(fetchedfile, "r")) |