Sha256: f98af33f79f0a2a4593c93afd0110dc6261af641c1a2571d8be8bbbafe76d610
Contents?: true
Size: 1.21 KB
Versions: 11
Compression:
Stored size: 1.21 KB
Contents
#TODO - rename responses directory to templates @command_line Feature: 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 'http://localhost:7001/mirage/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 'http://localhost:7001/mirage/responses/greeting' Then 'hello' should be returned
Version data entries
11 entries across 11 versions & 1 rubygems