| 1 | #define _POSIX_C_SOURCE 200809L |
| 2 | #include <cgreen/cgreen.h> |
| 3 | |
| 4 | /* TODO: are these include necessary? */ |
| 5 | #include <stdio.h> |
| 6 | #include <unistd.h> |
| 7 | #include <stdlib.h> |
| 8 | |
| 9 | |
| 10 | #ifdef __cplusplus |
| 11 | using namespace cgreen; |
| 12 | #endif |
| 13 | |
| 14 | Describe(EnvironmentVariables); |
| 15 | BeforeEach(EnvironmentVariables) { setenv("TEST", "test", true); } |
| 16 | AfterEach(EnvironmentVariables) {} |
| 17 | |
| 18 | Ensure(EnvironmentVariables, set_in_before_each_should_be_set_in_test) { |
| 19 | assert_that(getenv("TEST"), is_equal_to_string("test")); |
| 20 | } |