Last active
July 16, 2022 17:51
-
-
Save deepal/8ec5106d91c759a82db38c79f05e2238 to your computer and use it in GitHub Desktop.
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
describe("check_env module", function () | |
local check_env = require "lib.check_env" | |
before_each(function() | |
stub(os, "getenv") | |
end) | |
after_each(function () | |
os.getenv:revert() | |
end) | |
it("should return true if RUN_SUM env variable is set to '1'", function () | |
os.getenv.on_call_with("RUN_SUM").returns("1") | |
assert.True(check_env()) | |
end) | |
it("should return false if RUN_SUM env variable is not set", function () | |
os.getenv.on_call_with("RUN_SUM").returns(nil) | |
assert.False(check_env()) | |
end) | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment