Sha256: 469b5555ba7bd74a252468523324e83385f83c6ae49802ea3901e0b4f6f0c1bd

Contents?: true

Size: 1.11 KB

Versions: 2

Compression:

Stored size: 1.11 KB

Contents

require File.join '.', 'test', 'helper'

describe "Matching pretty-formatted bodies" do
  before do
    @curl_reply = CurlReply.new <<-TEXT
      HTTP/1.1 200 OK
      Content-Type: text/xml; charset=utf-8

      <?xml version="1.0" encoding="utf-8"?><current><city id="6058560" name="London" /><humidity value="76" unit="%"/><pressure value="1018" unit="hPa"/></current>
    TEXT
  end

  it "matches when you have neither pretty formatted" do
    @curl_reply.must_match <<-TEXT
      HTTP/1.1 200 OK
      Content-Type: text/xml; charset=utf-8

      <?xml version="1.0" encoding="utf-8"?><current><city id="6058560" name="London" /><humidity value="76" unit="%"/><pressure value="1018" unit="hPa"/></current>
    TEXT
  end

  it "matches when you say yes to pretty bodies" do
    @curl_reply.use_pretty_xml
    @curl_reply.must_match <<-TEXT
      HTTP/1.1 200 OK
      Content-Type: text/xml; charset=utf-8

      <?xml version="1.0" encoding="utf-8"?>
      <current>
        <city id="6058560" name="London"/>
        <humidity value="76" unit="%"/>
        <pressure value="1018" unit="hPa"/>
      </current>
    TEXT
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
richard_iii-0.1.1 test/unit.tests/can_match_pretty_formatted_xml_bodies.rb
richard_iii-0.1.0 test/unit.tests/can_match_pretty_formatted_xml_bodies.rb