Skip to content

Commit

Permalink
Adjusted tmp file name and test
Browse files Browse the repository at this point in the history
  • Loading branch information
Björn Ritzl committed Dec 19, 2016
1 parent f6de63f commit 1c4b0a9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions googleanalytics/internal/file.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ function M.save(name, data)
assert(name, "You must provide a file name")
assert(data, "You must provide some data")
assert(type(data) == "string", "You can only write strings")
local tmpname = M.get_save_file_name("___gatmp")
os.remove(tmpname)
local tmpname = M.get_save_file_name("__ga_tmp")
local file, err = io.open(tmpname, "w+")
if not file then
return nil, err
Expand Down
1 change: 0 additions & 1 deletion tests/test_file.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ return function()
it("should write to a temporary file and then move it if successful", function()
file.save("foobar", "some data")

assert(os.tmpname.calls == 1)
assert(os.rename.calls == 1)
assert(os.remove.calls == 1)
end)
Expand Down

0 comments on commit 1c4b0a9

Please sign in to comment.