Sha256: 1cd8f78df035d230fb7256580e2b5e2c34344dc5211346ec6982002f2fe40ed7

Contents?: true

Size: 656 Bytes

Versions: 2

Compression:

Stored size: 656 Bytes

Contents

require "cucumber/rest/body"

describe Cucumber::Rest::Body, :body do
  context "#ensure_empty" do
    def generate_response(body: nil)
      response = MockResponse.new
      response.body = body
      response
    end

    it "does not raise an error when the response body is empty" do
      response = generate_response(body: nil)
      expect { Cucumber::Rest::Body.ensure_empty(response: response) }.to_not raise_error
    end

    it "raises an error when the response body is non-empty" do
      response = generate_response(body: "something")
      expect { Cucumber::Rest::Body.ensure_empty(response: response) }.to raise_error
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cucumber-rest-0.1.10 spec/cucumber/rest/body_spec.rb
cucumber-rest-0.0.0 spec/cucumber/rest/body_spec.rb