Sha256: 080140066ed69b5a691a9a1550fbcec3c98de3d38d3cbef1b0870fc8705b738f

Contents?: true

Size: 1.18 KB

Versions: 6

Compression:

Stored size: 1.18 KB

Contents

#TODO - rename responses directory to templates
@command_line
Feature: Preloading templates
  Mirage can be primed with a set of templates.
  By default, Mirage loads any .rb files found in ./responses on startup. Mirage can also be made to load responses from a directory
  of your choosing by using the -d/--defaults option

  Responses can be added to the responses directory and used to prime Mirage after Mirage has been started.

  Priming causes any modifications to Mirage's current state to be lost.


  Scenario: Using the default responses directory
    Given the file 'responses/default_greetings.rb' contains:
    """
    prime do |mirage|
      mirage.templates.put('greeting', 'hello')
    end
    """
    And I run 'mirage start'
    When GET is sent to '/responses/greeting'
    Then 'hello' should be returned


  Scenario: Using a custom responses directory
    Given Mirage is not running
    And the file '/tmp/responses/default_greetings.rb' contains:
    """
    prime do |mirage|
      mirage.templates.put('greeting', 'hello')
    end
    """
    And I run 'mirage start --defaults /tmp/responses'
    And GET is sent to '/responses/greeting'
    Then 'hello' should be returned

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mirage-3.0.0.alpha.17 features/prime.feature
mirage-3.0.0.alpha.16 features/prime.feature
mirage-3.0.0.alpha.15 features/prime.feature
mirage-3.0.0.alpha.14 features/prime.feature
mirage-3.0.0.alpha.13 features/prime.feature
mirage-3.0.0.alpha.12 features/prime.feature