Sha256: 119307696611a0bd70ca8832c00bd348db4acd7b2f54c8b3f2b6e5159b56d1fe

Contents?: true

Size: 1.66 KB

Versions: 10

Compression:

Stored size: 1.66 KB

Contents

Feature: Configuring Templates

  If you find yourself setting the same basic http settings for templates, the client can be configured to preset these.

  Background:
    Given the following require statements are needed:
    """
    require 'rubygems'
    require 'rspec/expectations'
    require 'mirage/client'
    """

  Scenario: configuring the client on instance
    Given I run
    """
    client = Mirage::Client.new do
      http_method :post
      status 202
      default true
      delay 2
      content_type "text/xml"
    end

    client.put('greeting','hello')
    """
    When POST is sent to '/responses/greeting/for/someone'
    Then 'hello' should be returned
    And a 202 should be returned
    Then it should take at least '2' seconds
    And the response 'content-type' should be 'text/xml'

  Scenario: Configuring a client after it has been created
    Given I run
    """
    client = Mirage::Client.new
    client.configure do
      http_method :post
      status 202
      default false
      delay 2
      content_type "text/xml"
    end

    client.put('greeting','hello')
    """
    When POST is sent to '/responses/greeting'
    Then 'hello' should be returned
    And a 202 should be returned
    Then it should take at least '2' seconds
    And the response 'content-type' should be 'text/xml'

  Scenario: resetting defaults
    Given I run
    """
    client = Mirage::Client.new
    client.configure do
      http_method :post
      status 202
      default true
      delay 2
      content_type "text/xml"
    end

    client.reset
    client.put('greeting','hello')
    """
    When GET is sent to '/responses/greeting'
    Then 'hello' should be returned




Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
mirage-3.0.13 features/client/configure.feature
mirage-3.0.12 features/client/configure.feature
mirage-3.0.11 features/client/configure.feature
mirage-3.0.10 features/client/configure.feature
mirage-3.0.9 features/client/configure.feature
mirage-on-thin-3.0.8 features/client/configure.feature
mirage-3.0.8 features/client/configure.feature
mirage-3.0.7 features/client/configure.feature
mirage-3.0.6 features/client/configure.feature
mirage-3.0.5 features/client/configure.feature