Skip to content
  • Georges Racinet's avatar
    RSpec: request and store HGitaly version on configuration object · ea7d9baf84e2
    Georges Racinet authored
    With this, the HGitaly version will be accessible as
    `RSpec.configuration.hgitaly_version`, and mostly used
    for conditional skipping, making hooking in Rails and
    landing in HGitaly less interdependent, provided new
    features in HGitaly come with an appropriate version
    change (doesn't have to be pushed to PyPI because the
    CI always run HGitaly from the head of the `default` or
    `stable` branch).
    
    The simplest syntax to skip RSpec tests is
    
    ```ruby
    
      if 'does something', skip: boolean_method
    
    ```
    
    but `boolean_method` would have to be a class method, and
    would turn out to be executed before `TestEnv`, hence before
    HGitaly is started. Therefore the `skip` method will have to
    be run from examples (and `before` hooks). The new
    `RSpec.configuration` method is a good way to access the version
    information. It's not lazy, but it's expected to be negligible
    compared to the huge startup time.
    ea7d9baf84e2