stefanbirkner/system-rules

EnvironmentVariables clear() does not work properly

Opened this issue · 0 comments

I have a test dependent of environment variables. I am setting environment variable in @before like this.

    @Rule
    public final EnvironmentVariables environmentVariables = new EnvironmentVariables();

@Before
    public void setUp() throws Exception {
        environmentVariables.set("someValue","testLink");
    }

In one of the test I need to clear the same environment variable. But when I do this:

environmentVariables.clear("someValue");

When I run the test alone it works fine but when I run all the tests in the class, environment variable is not cleared. Probably I am missin something but it can be a bug as well.