Contents

Disabling the dspec global functions

In order to prevent name clashes As a developer I need to prevent dspec loading the global functions

Scenario: Disable global via with an environment variable

  • Given a file named "TestSpec.php" with:
    php
    <?php
    
    use DSpec\DSpec as ds;
    
    function fail() {}
    
    ds::describe("test", function() {
        ds::it("should pass", function() {
        });
    });
  • When I run `DSPEC_NO_GLOBALS=1 dspec TestSpec.php`
  • Then the output should contain "1 example passed"

Source: features/command_line/no_globals.feature at commit cf8c810b, Dspec (MIT license).