Sha256: 14a67b8fd9b5f3e5265e9e99e576653a6f1ba8c5e26a2f21e697930d4eb9a10b

Contents?: true

Size: 1.43 KB

Versions: 12

Compression:

Stored size: 1.43 KB

Contents

Feature: the Mirage client provides a method for getting responses
  There is no need to escape any parameters before using the client api as this is done for you.

  Background:
    Given the following gems are required to run the Mirage client test code:
    """
    require 'rubygems'
    require 'rspec'
    require 'mirage'
    """
    And I post to 'http://localhost:7001/mirage/set/greeting' with parameters:
      | response | hello |

  Scenario: getting a response
    Given I run
    """
    Mirage::Client.new.get('greeting').should == 'hello'
    """

  Scenario: getting a response with parameters
    Given I run
    """
    Mirage::Client.new.get('greeting', :firstname => 'leon', :surname => 'davis').should == 'hello'
    """
    And I hit 'http://localhost:7001/mirage/track/1'
    Then 'firstname=leon&surname=davis' should be returned

  Scenario: getting a response with a request body
    Given I run
    """
    Mirage::Client.new.get('greeting','<greetingRequest></greetingRequest>').should == 'hello'
    """
    And I hit 'http://localhost:7001/mirage/track/1'
    Then '<greetingRequest></greetingRequest>' should be returned

  Scenario: getting a response that does not exist
    Given I run
    """
    begin
      Mirage::Client.new.get('response_that_does_not_exits').should == 'hello'
      fail("Error should have been thrown")
    rescue Exception => e
      e.is_a?(Mirage::ResponseNotFound).should == true
    end
    """

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mirage-1.3.6 features/client/get.feature
mirage-1.3.5 features/client/get.feature
mirage-1.3.4 features/client/get.feature
mirage-1.3.3 features/client/get.feature
mirage-1.3.2 features/client/get.feature
mirage-1.3.1 features/client/get.feature
mirage-1.3.0 features/client/get.feature
mirage-1.2.0 features/client/get.feature
mirage-1.1.0 features/client/get.feature
mirage-1.0.2 features/client/get.feature
mirage-1.0.1 features/client/get.feature
mirage-1.0.0 features/client/get.feature