myst-lang / myst

A structured, dynamic, general-purpose language.
http://myst-lang.org
MIT License
119 stars 17 forks source link

Fixes #184. Don't show warning output when running specs. #188

Closed faultyserver closed 6 years ago

faultyserver commented 6 years ago

The specs no longer output WARNING messages about referencing underscores.

The root issue that caused this was that the VM was almost always setting ENV["MYST_ENV"] = "prod", which would screw up tests that ran later in the pipeline, since they weren't resetting the variable.

Part of this PR is removing MYST_ENV from the interpreter. The same behavior that it was implementing has been possible using interpret_with_mocked_output for quite a while now, so it makes sense to be consistent with it.

In general, using environment variables for configuring the interpreter should be avoided. Instead (especially since the VM is embeddable in any crystal projects), this should be done with flags on the interpreter that can also be set through the CLI. This gives much finer control over execution and isolates instances of the interpreter from the global state of environment variables.