coverage/index.html in contentful-2.2.1 vs coverage/index.html in contentful-2.2.2
- old
+ new
@@ -12,30 +12,30 @@
<body>
<div id="loading">
<img src="./assets/0.10.2/loading.gif" alt="loading"/>
</div>
<div id="wrapper" style="display:none;">
- <div class="timestamp">Generated <abbr class="timeago" title="2017-10-25T11:55:54+02:00">2017-10-25T11:55:54+02:00</abbr></div>
+ <div class="timestamp">Generated <abbr class="timeago" title="2017-11-15T11:06:18+01:00">2017-11-15T11:06:18+01:00</abbr></div>
<ul class="group_tabs"></ul>
<div id="content">
<div class="file_list_container" id="AllFiles">
<h2>
<span class="group_name">All Files</span>
- (<span class="covered_percent"><span class="green">98.91%</span></span>
+ (<span class="covered_percent"><span class="green">98.92%</span></span>
covered at
<span class="covered_strength">
<span class="green">
- 438.22
+ 436.7
</span>
</span> hits/line)
</h2>
<a name="AllFiles"></a>
<div>
<b>50</b> files in total.
- <b>1930</b> relevant lines.
- <span class="green"><b>1909</b> lines covered</span> and
+ <b>1937</b> relevant lines.
+ <span class="green"><b>1916</b> lines covered</span> and
<span class="red"><b>21</b> lines missed </span>
</div>
<table class="file_list">
<thead>
<tr>
@@ -170,16 +170,16 @@
<td>1649.4</td>
</tr>
<tr>
<td class="strong"><a href="#98433a4cac96676bcf6b420f480c3d946ae0d0cb" class="src_link" title="lib/contentful/error.rb">lib/contentful/error.rb</a></td>
- <td class="green strong">98.91 %</td>
- <td>203</td>
+ <td class="green strong">98.92 %</td>
+ <td>204</td>
+ <td>93</td>
<td>92</td>
- <td>91</td>
<td>1</td>
- <td>13.1</td>
+ <td>13.6</td>
</tr>
<tr>
<td class="strong"><a href="#4f89ce6a6221e537edb751b920a159e36a286ebd" class="src_link" title="lib/contentful/field.rb">lib/contentful/field.rb</a></td>
<td class="green strong">100.0 %</td>
@@ -265,11 +265,11 @@
<td class="green strong">100.0 %</td>
<td>107</td>
<td>55</td>
<td>55</td>
<td>0</td>
- <td>57.0</td>
+ <td>57.5</td>
</tr>
<tr>
<td class="strong"><a href="#42827798fb56cb87d145e81d9ae46dfe97e9818b" class="src_link" title="lib/contentful/space.rb">lib/contentful/space.rb</a></td>
<td class="yellow strong">83.33 %</td>
@@ -391,13 +391,13 @@
</tr>
<tr>
<td class="strong"><a href="#ba5ec4bdbf6ab50e064edb4d1e274e870b307f6e" class="src_link" title="spec/error_class_spec.rb">spec/error_class_spec.rb</a></td>
<td class="green strong">100.0 %</td>
- <td>314</td>
- <td>145</td>
- <td>145</td>
+ <td>327</td>
+ <td>151</td>
+ <td>151</td>
<td>0</td>
<td>1.0</td>
</tr>
<tr>
@@ -515,11 +515,11 @@
<td class="green strong">100.0 %</td>
<td>18</td>
<td>11</td>
<td>11</td>
<td>0</td>
- <td>61.3</td>
+ <td>63.1</td>
</tr>
<tr>
<td class="strong"><a href="#027342a1ab3607ccd90fe9e5972948d26cbc8bed" class="src_link" title="spec/support/vcr.rb">spec/support/vcr.rb</a></td>
<td class="green strong">100.0 %</td>
@@ -6663,14 +6663,14 @@
<div class="source_table" id="98433a4cac96676bcf6b420f480c3d946ae0d0cb">
<div class="header">
<h3>lib/contentful/error.rb</h3>
- <h4><span class="green">98.91 %</span> covered</h4>
+ <h4><span class="green">98.92 %</span> covered</h4>
<div>
- <b>92</b> relevant lines.
- <span class="green"><b>91</b> lines covered</span> and
+ <b>93</b> relevant lines.
+ <span class="green"><b>92</b> lines covered</span> and
<span class="red"><b>1</b> lines missed.</span>
</div>
</div>
<pre>
@@ -6716,18 +6716,18 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(response)</code>
</li>
- <li class="covered" data-hits="63" data-linenumber="8">
- <span class="hits">63</span>
+ <li class="covered" data-hits="65" data-linenumber="8">
+ <span class="hits">65</span>
<code class="ruby"> @response = response</code>
</li>
- <li class="covered" data-hits="63" data-linenumber="9">
- <span class="hits">63</span>
+ <li class="covered" data-hits="65" data-linenumber="9">
+ <span class="hits">65</span>
<code class="ruby"> super best_available_message</code>
</li>
<li class="never" data-hits="" data-linenumber="10">
@@ -6758,12 +6758,12 @@
<span class="hits">1</span>
<code class="ruby"> def self.[](error_status_code)</code>
</li>
- <li class="covered" data-hits="64" data-linenumber="15">
- <span class="hits">64</span>
+ <li class="covered" data-hits="66" data-linenumber="15">
+ <span class="hits">66</span>
<code class="ruby"> errors = {</code>
</li>
<li class="never" data-hits="" data-linenumber="16">
@@ -6824,12 +6824,12 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="64" data-linenumber="26">
- <span class="hits">64</span>
+ <li class="covered" data-hits="66" data-linenumber="26">
+ <span class="hits">66</span>
<code class="ruby"> errors.key?(error_status_code) ? errors[error_status_code] : Error</code>
</li>
<li class="never" data-hits="" data-linenumber="27">
@@ -6908,12 +6908,12 @@
<span class="hits">1</span>
<code class="ruby"> def additional_info?</code>
</li>
- <li class="covered" data-hits="57" data-linenumber="40">
- <span class="hits">57</span>
+ <li class="covered" data-hits="59" data-linenumber="40">
+ <span class="hits">59</span>
<code class="ruby"> false</code>
</li>
<li class="never" data-hits="" data-linenumber="41">
@@ -6956,12 +6956,12 @@
<span class="hits">1</span>
<code class="ruby"> def best_available_message</code>
</li>
- <li class="covered" data-hits="63" data-linenumber="48">
- <span class="hits">63</span>
+ <li class="covered" data-hits="65" data-linenumber="48">
+ <span class="hits">65</span>
<code class="ruby"> error_message = [</code>
</li>
<li class="never" data-hits="" data-linenumber="49">
@@ -6980,60 +6980,60 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="63" data-linenumber="52">
- <span class="hits">63</span>
+ <li class="covered" data-hits="65" data-linenumber="52">
+ <span class="hits">65</span>
<code class="ruby"> begin</code>
</li>
- <li class="covered" data-hits="63" data-linenumber="53">
- <span class="hits">63</span>
+ <li class="covered" data-hits="65" data-linenumber="53">
+ <span class="hits">65</span>
<code class="ruby"> response_json = @response.load_json</code>
</li>
- <li class="covered" data-hits="59" data-linenumber="54">
- <span class="hits">59</span>
+ <li class="covered" data-hits="61" data-linenumber="54">
+ <span class="hits">61</span>
<code class="ruby"> message = response_json.fetch('message', default_error_message)</code>
</li>
- <li class="covered" data-hits="59" data-linenumber="55">
- <span class="hits">59</span>
+ <li class="covered" data-hits="61" data-linenumber="55">
+ <span class="hits">61</span>
<code class="ruby"> details = response_json.fetch('details', nil)</code>
</li>
- <li class="covered" data-hits="59" data-linenumber="56">
- <span class="hits">59</span>
+ <li class="covered" data-hits="61" data-linenumber="56">
+ <span class="hits">61</span>
<code class="ruby"> request_id = response_json.fetch('requestId', nil)</code>
</li>
<li class="never" data-hits="" data-linenumber="57">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="59" data-linenumber="58">
- <span class="hits">59</span>
+ <li class="covered" data-hits="61" data-linenumber="58">
+ <span class="hits">61</span>
<code class="ruby"> error_message << "Message: #{message}"</code>
</li>
- <li class="covered" data-hits="59" data-linenumber="59">
- <span class="hits">59</span>
+ <li class="covered" data-hits="61" data-linenumber="59">
+ <span class="hits">61</span>
<code class="ruby"> error_message << "Details: #{handle_details(details)}" if details</code>
</li>
- <li class="covered" data-hits="59" data-linenumber="60">
- <span class="hits">59</span>
+ <li class="covered" data-hits="61" data-linenumber="60">
+ <span class="hits">61</span>
<code class="ruby"> error_message << "Request ID: #{request_id}" if request_id</code>
</li>
<li class="never" data-hits="" data-linenumber="61">
@@ -7058,24 +7058,24 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="63" data-linenumber="65">
- <span class="hits">63</span>
+ <li class="covered" data-hits="65" data-linenumber="65">
+ <span class="hits">65</span>
<code class="ruby"> error_message << additional_info if additional_info?</code>
</li>
<li class="never" data-hits="" data-linenumber="66">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="63" data-linenumber="67">
- <span class="hits">63</span>
+ <li class="covered" data-hits="65" data-linenumber="67">
+ <span class="hits">65</span>
<code class="ruby"> error_message.join("\n")</code>
</li>
<li class="never" data-hits="" data-linenumber="68">
@@ -7382,12 +7382,12 @@
<span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="covered" data-hits="15" data-linenumber="119">
- <span class="hits">15</span>
+ <li class="covered" data-hits="17" data-linenumber="119">
+ <span class="hits">17</span>
<code class="ruby"> 'The requested resource or endpoint could not be found.'</code>
</li>
<li class="never" data-hits="" data-linenumber="120">
@@ -7406,491 +7406,497 @@
<span class="hits">1</span>
<code class="ruby"> def handle_details(details)</code>
</li>
- <li class="covered" data-hits="10" data-linenumber="123">
- <span class="hits">10</span>
+ <li class="covered" data-hits="12" data-linenumber="123">
+ <span class="hits">12</span>
<code class="ruby"> return details if details.is_a?(String)</code>
</li>
<li class="never" data-hits="" data-linenumber="124">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="8" data-linenumber="125">
- <span class="hits">8</span>
+ <li class="covered" data-hits="10" data-linenumber="125">
+ <span class="hits">10</span>
- <code class="ruby"> message = "The requested #{details['type']} could not be found."</code>
+ <code class="ruby"> type = details['type'] || (details['sys'] || {})['type']</code>
</li>
- <li class="never" data-hits="" data-linenumber="126">
+ <li class="covered" data-hits="10" data-linenumber="126">
+ <span class="hits">10</span>
+ <code class="ruby"> message = "The requested #{type} could not be found."</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="127">
+
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="8" data-linenumber="127">
- <span class="hits">8</span>
+ <li class="covered" data-hits="10" data-linenumber="128">
+ <span class="hits">10</span>
<code class="ruby"> resource_id = details.fetch('id', nil)</code>
</li>
- <li class="covered" data-hits="8" data-linenumber="128">
- <span class="hits">8</span>
+ <li class="covered" data-hits="10" data-linenumber="129">
+ <span class="hits">10</span>
<code class="ruby"> message += " ID: #{resource_id}." if resource_id</code>
</li>
- <li class="never" data-hits="" data-linenumber="129">
+ <li class="never" data-hits="" data-linenumber="130">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="8" data-linenumber="130">
- <span class="hits">8</span>
+ <li class="covered" data-hits="10" data-linenumber="131">
+ <span class="hits">10</span>
<code class="ruby"> message</code>
</li>
- <li class="never" data-hits="" data-linenumber="131">
+ <li class="never" data-hits="" data-linenumber="132">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="132">
+ <li class="never" data-hits="" data-linenumber="133">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="133">
+ <li class="never" data-hits="" data-linenumber="134">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="134">
+ <li class="never" data-hits="" data-linenumber="135">
<code class="ruby"> # 429</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="135">
+ <li class="covered" data-hits="1" data-linenumber="136">
<span class="hits">1</span>
<code class="ruby"> class RateLimitExceeded < Error</code>
</li>
- <li class="never" data-hits="" data-linenumber="136">
+ <li class="never" data-hits="" data-linenumber="137">
<code class="ruby"> # Rate Limit Reset Header Key</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="137">
+ <li class="covered" data-hits="1" data-linenumber="138">
<span class="hits">1</span>
<code class="ruby"> RATE_LIMIT_RESET_HEADER_KEY = 'x-contentful-ratelimit-reset'</code>
</li>
- <li class="never" data-hits="" data-linenumber="138">
+ <li class="never" data-hits="" data-linenumber="139">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="139">
+ <li class="covered" data-hits="1" data-linenumber="140">
<span class="hits">1</span>
<code class="ruby"> def reset_time?</code>
</li>
- <li class="never" data-hits="" data-linenumber="140">
+ <li class="never" data-hits="" data-linenumber="141">
<code class="ruby"> # rubocop:disable Style/DoubleNegation</code>
</li>
- <li class="covered" data-hits="6" data-linenumber="141">
+ <li class="covered" data-hits="6" data-linenumber="142">
<span class="hits">6</span>
<code class="ruby"> !!reset_time</code>
</li>
- <li class="never" data-hits="" data-linenumber="142">
+ <li class="never" data-hits="" data-linenumber="143">
<code class="ruby"> # rubocop:enable Style/DoubleNegation</code>
</li>
- <li class="never" data-hits="" data-linenumber="143">
+ <li class="never" data-hits="" data-linenumber="144">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="144">
+ <li class="never" data-hits="" data-linenumber="145">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="145">
+ <li class="never" data-hits="" data-linenumber="146">
<code class="ruby"> # Time until next available request, in seconds.</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="146">
+ <li class="covered" data-hits="1" data-linenumber="147">
<span class="hits">1</span>
<code class="ruby"> def reset_time</code>
</li>
- <li class="covered" data-hits="11" data-linenumber="147">
+ <li class="covered" data-hits="11" data-linenumber="148">
<span class="hits">11</span>
<code class="ruby"> @reset_time ||= @response.raw[RATE_LIMIT_RESET_HEADER_KEY]</code>
</li>
- <li class="never" data-hits="" data-linenumber="148">
+ <li class="never" data-hits="" data-linenumber="149">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="149">
+ <li class="never" data-hits="" data-linenumber="150">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="150">
+ <li class="covered" data-hits="1" data-linenumber="151">
<span class="hits">1</span>
<code class="ruby"> protected</code>
</li>
- <li class="never" data-hits="" data-linenumber="151">
+ <li class="never" data-hits="" data-linenumber="152">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="152">
+ <li class="covered" data-hits="1" data-linenumber="153">
<span class="hits">1</span>
<code class="ruby"> def additional_info?</code>
</li>
- <li class="covered" data-hits="6" data-linenumber="153">
+ <li class="covered" data-hits="6" data-linenumber="154">
<span class="hits">6</span>
<code class="ruby"> reset_time?</code>
</li>
- <li class="never" data-hits="" data-linenumber="154">
+ <li class="never" data-hits="" data-linenumber="155">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="155">
+ <li class="never" data-hits="" data-linenumber="156">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="156">
+ <li class="covered" data-hits="1" data-linenumber="157">
<span class="hits">1</span>
<code class="ruby"> def additional_info</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="157">
+ <li class="covered" data-hits="3" data-linenumber="158">
<span class="hits">3</span>
<code class="ruby"> ["Time until reset (seconds): #{reset_time}"]</code>
</li>
- <li class="never" data-hits="" data-linenumber="158">
+ <li class="never" data-hits="" data-linenumber="159">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="159">
+ <li class="never" data-hits="" data-linenumber="160">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="160">
+ <li class="covered" data-hits="1" data-linenumber="161">
<span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="covered" data-hits="6" data-linenumber="161">
+ <li class="covered" data-hits="6" data-linenumber="162">
<span class="hits">6</span>
<code class="ruby"> 'Rate limit exceeded. Too many requests.'</code>
</li>
- <li class="never" data-hits="" data-linenumber="162">
+ <li class="never" data-hits="" data-linenumber="163">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="163">
+ <li class="never" data-hits="" data-linenumber="164">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="164">
+ <li class="never" data-hits="" data-linenumber="165">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="165">
+ <li class="never" data-hits="" data-linenumber="166">
<code class="ruby"> # 500</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="166">
+ <li class="covered" data-hits="1" data-linenumber="167">
<span class="hits">1</span>
<code class="ruby"> class ServerError < Error</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="167">
+ <li class="covered" data-hits="1" data-linenumber="168">
<span class="hits">1</span>
<code class="ruby"> protected</code>
</li>
- <li class="never" data-hits="" data-linenumber="168">
+ <li class="never" data-hits="" data-linenumber="169">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="169">
+ <li class="covered" data-hits="1" data-linenumber="170">
<span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="170">
+ <li class="covered" data-hits="2" data-linenumber="171">
<span class="hits">2</span>
<code class="ruby"> 'Internal server error.'</code>
</li>
- <li class="never" data-hits="" data-linenumber="171">
+ <li class="never" data-hits="" data-linenumber="172">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="172">
+ <li class="never" data-hits="" data-linenumber="173">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="173">
+ <li class="never" data-hits="" data-linenumber="174">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="174">
+ <li class="never" data-hits="" data-linenumber="175">
<code class="ruby"> # 502</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="175">
+ <li class="covered" data-hits="1" data-linenumber="176">
<span class="hits">1</span>
<code class="ruby"> class BadGateway < Error</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="176">
+ <li class="covered" data-hits="1" data-linenumber="177">
<span class="hits">1</span>
<code class="ruby"> protected</code>
</li>
- <li class="never" data-hits="" data-linenumber="177">
+ <li class="never" data-hits="" data-linenumber="178">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="178">
+ <li class="covered" data-hits="1" data-linenumber="179">
<span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="179">
+ <li class="covered" data-hits="2" data-linenumber="180">
<span class="hits">2</span>
<code class="ruby"> 'The requested space is hibernated.'</code>
</li>
- <li class="never" data-hits="" data-linenumber="180">
+ <li class="never" data-hits="" data-linenumber="181">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="181">
+ <li class="never" data-hits="" data-linenumber="182">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="182">
+ <li class="never" data-hits="" data-linenumber="183">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="183">
+ <li class="never" data-hits="" data-linenumber="184">
<code class="ruby"> # 503</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="184">
+ <li class="covered" data-hits="1" data-linenumber="185">
<span class="hits">1</span>
<code class="ruby"> class ServiceUnavailable < Error</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="185">
+ <li class="covered" data-hits="1" data-linenumber="186">
<span class="hits">1</span>
<code class="ruby"> protected</code>
</li>
- <li class="never" data-hits="" data-linenumber="186">
+ <li class="never" data-hits="" data-linenumber="187">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="187">
+ <li class="covered" data-hits="1" data-linenumber="188">
<span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="188">
+ <li class="covered" data-hits="4" data-linenumber="189">
<span class="hits">4</span>
<code class="ruby"> 'The request was malformed or missing a required parameter.'</code>
</li>
- <li class="never" data-hits="" data-linenumber="189">
+ <li class="never" data-hits="" data-linenumber="190">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="190">
+ <li class="never" data-hits="" data-linenumber="191">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="191">
+ <li class="never" data-hits="" data-linenumber="192">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="192">
+ <li class="never" data-hits="" data-linenumber="193">
<code class="ruby"> # Raised when response is no valid json</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="193">
+ <li class="covered" data-hits="1" data-linenumber="194">
<span class="hits">1</span>
<code class="ruby"> class UnparsableJson < Error</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="194">
+ <li class="covered" data-hits="1" data-linenumber="195">
<span class="hits">1</span>
<code class="ruby"> protected</code>
</li>
- <li class="never" data-hits="" data-linenumber="195">
+ <li class="never" data-hits="" data-linenumber="196">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="196">
+ <li class="covered" data-hits="1" data-linenumber="197">
<span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="197">
+ <li class="covered" data-hits="4" data-linenumber="198">
<span class="hits">4</span>
<code class="ruby"> @response.error_message</code>
</li>
- <li class="never" data-hits="" data-linenumber="198">
+ <li class="never" data-hits="" data-linenumber="199">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="199">
+ <li class="never" data-hits="" data-linenumber="200">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="200">
+ <li class="never" data-hits="" data-linenumber="201">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="201">
+ <li class="never" data-hits="" data-linenumber="202">
<code class="ruby"> # Raised when response is not parsable as a Contentful::Resource</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="202">
+ <li class="covered" data-hits="1" data-linenumber="203">
<span class="hits">1</span>
<code class="ruby"> class UnparsableResource < StandardError; end</code>
</li>
- <li class="never" data-hits="" data-linenumber="203">
+ <li class="never" data-hits="" data-linenumber="204">
<code class="ruby">end</code>
</li>
@@ -10811,66 +10817,66 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(raw, request = nil)</code>
</li>
- <li class="covered" data-hits="231" data-linenumber="27">
- <span class="hits">231</span>
+ <li class="covered" data-hits="232" data-linenumber="27">
+ <span class="hits">232</span>
<code class="ruby"> @raw = raw</code>
</li>
- <li class="covered" data-hits="231" data-linenumber="28">
- <span class="hits">231</span>
+ <li class="covered" data-hits="232" data-linenumber="28">
+ <span class="hits">232</span>
<code class="ruby"> @request = request</code>
</li>
- <li class="covered" data-hits="231" data-linenumber="29">
- <span class="hits">231</span>
+ <li class="covered" data-hits="232" data-linenumber="29">
+ <span class="hits">232</span>
<code class="ruby"> @status = :ok</code>
</li>
<li class="never" data-hits="" data-linenumber="30">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="231" data-linenumber="31">
- <span class="hits">231</span>
+ <li class="covered" data-hits="232" data-linenumber="31">
+ <span class="hits">232</span>
<code class="ruby"> if valid_http_response?</code>
</li>
<li class="covered" data-hits="195" data-linenumber="32">
<span class="hits">195</span>
<code class="ruby"> parse_json!</code>
</li>
- <li class="covered" data-hits="36" data-linenumber="33">
- <span class="hits">36</span>
+ <li class="covered" data-hits="37" data-linenumber="33">
+ <span class="hits">37</span>
<code class="ruby"> elsif no_content_response?</code>
</li>
<li class="covered" data-hits="1" data-linenumber="34">
<span class="hits">1</span>
<code class="ruby"> @status = :no_content</code>
</li>
- <li class="covered" data-hits="35" data-linenumber="35">
- <span class="hits">35</span>
+ <li class="covered" data-hits="36" data-linenumber="35">
+ <span class="hits">36</span>
<code class="ruby"> elsif invalid_response?</code>
</li>
- <li class="covered" data-hits="17" data-linenumber="36">
- <span class="hits">17</span>
+ <li class="covered" data-hits="18" data-linenumber="36">
+ <span class="hits">18</span>
<code class="ruby"> parse_contentful_error</code>
</li>
<li class="covered" data-hits="18" data-linenumber="37">
@@ -10925,12 +10931,12 @@
<span class="hits">1</span>
<code class="ruby"> def load_json</code>
</li>
- <li class="covered" data-hits="275" data-linenumber="46">
- <span class="hits">275</span>
+ <li class="covered" data-hits="278" data-linenumber="46">
+ <span class="hits">278</span>
<code class="ruby"> MultiJson.load(unzip_response(raw))</code>
</li>
<li class="never" data-hits="" data-linenumber="47">
@@ -10961,12 +10967,12 @@
<span class="hits">1</span>
<code class="ruby"> def error_object?</code>
</li>
- <li class="covered" data-hits="17" data-linenumber="52">
- <span class="hits">17</span>
+ <li class="covered" data-hits="18" data-linenumber="52">
+ <span class="hits">18</span>
<code class="ruby"> object['sys']['type'] == 'Error'</code>
</li>
<li class="never" data-hits="" data-linenumber="53">
@@ -10985,24 +10991,24 @@
<span class="hits">1</span>
<code class="ruby"> def parse_contentful_error</code>
</li>
- <li class="covered" data-hits="17" data-linenumber="56">
- <span class="hits">17</span>
+ <li class="covered" data-hits="18" data-linenumber="56">
+ <span class="hits">18</span>
<code class="ruby"> @object = load_json</code>
</li>
- <li class="covered" data-hits="17" data-linenumber="57">
- <span class="hits">17</span>
+ <li class="covered" data-hits="18" data-linenumber="57">
+ <span class="hits">18</span>
<code class="ruby"> @error_message = object['message'] if error_object?</code>
</li>
- <li class="covered" data-hits="17" data-linenumber="58">
- <span class="hits">17</span>
+ <li class="covered" data-hits="18" data-linenumber="58">
+ <span class="hits">18</span>
<code class="ruby"> parse_http_error</code>
</li>
<li class="never" data-hits="" data-linenumber="59">
@@ -11021,12 +11027,12 @@
<span class="hits">1</span>
<code class="ruby"> def valid_http_response?</code>
</li>
- <li class="covered" data-hits="231" data-linenumber="62">
- <span class="hits">231</span>
+ <li class="covered" data-hits="232" data-linenumber="62">
+ <span class="hits">232</span>
<code class="ruby"> [200, 201].include?(raw.status)</code>
</li>
<li class="never" data-hits="" data-linenumber="63">
@@ -11105,18 +11111,18 @@
<span class="hits">1</span>
<code class="ruby"> def parse_http_error</code>
</li>
- <li class="covered" data-hits="32" data-linenumber="76">
- <span class="hits">32</span>
+ <li class="covered" data-hits="33" data-linenumber="76">
+ <span class="hits">33</span>
<code class="ruby"> @status = :error</code>
</li>
- <li class="covered" data-hits="32" data-linenumber="77">
- <span class="hits">32</span>
+ <li class="covered" data-hits="33" data-linenumber="77">
+ <span class="hits">33</span>
<code class="ruby"> @object = Error[raw.status].new(self)</code>
</li>
<li class="never" data-hits="" data-linenumber="78">
@@ -11135,12 +11141,12 @@
<span class="hits">1</span>
<code class="ruby"> def invalid_response?</code>
</li>
- <li class="covered" data-hits="35" data-linenumber="81">
- <span class="hits">35</span>
+ <li class="covered" data-hits="36" data-linenumber="81">
+ <span class="hits">36</span>
<code class="ruby"> [400, 404].include?(raw.status)</code>
</li>
<li class="never" data-hits="" data-linenumber="82">
@@ -11159,12 +11165,12 @@
<span class="hits">1</span>
<code class="ruby"> def no_content_response?</code>
</li>
- <li class="covered" data-hits="36" data-linenumber="85">
- <span class="hits">36</span>
+ <li class="covered" data-hits="37" data-linenumber="85">
+ <span class="hits">37</span>
<code class="ruby"> raw.to_s == '' && raw.status == 204</code>
</li>
<li class="never" data-hits="" data-linenumber="86">
@@ -11231,18 +11237,18 @@
<span class="hits">1</span>
<code class="ruby"> def unzip_response(response)</code>
</li>
- <li class="covered" data-hits="275" data-linenumber="97">
- <span class="hits">275</span>
+ <li class="covered" data-hits="278" data-linenumber="97">
+ <span class="hits">278</span>
<code class="ruby"> parsed_response = response.to_s</code>
</li>
- <li class="covered" data-hits="275" data-linenumber="98">
- <span class="hits">275</span>
+ <li class="covered" data-hits="278" data-linenumber="98">
+ <span class="hits">278</span>
<code class="ruby"> if response.headers['Content-Encoding'].eql?('gzip')</code>
</li>
<li class="covered" data-hits="53" data-linenumber="99">
@@ -11267,12 +11273,12 @@
<code class="ruby"> else</code>
</li>
- <li class="covered" data-hits="222" data-linenumber="103">
- <span class="hits">222</span>
+ <li class="covered" data-hits="225" data-linenumber="103">
+ <span class="hits">225</span>
<code class="ruby"> parsed_response</code>
</li>
<li class="never" data-hits="" data-linenumber="104">
@@ -19515,12 +19521,12 @@
<div class="source_table" id="ba5ec4bdbf6ab50e064edb4d1e274e870b307f6e">
<div class="header">
<h3>spec/error_class_spec.rb</h3>
<h4><span class="green">100.0 %</span> covered</h4>
<div>
- <b>145</b> relevant lines.
- <span class="green"><b>145</b> lines covered</span> and
+ <b>151</b> relevant lines.
+ <span class="green"><b>151</b> lines covered</span> and
<span class="red"><b>0</b> lines missed.</span>
</div>
</div>
<pre>
@@ -20529,884 +20535,962 @@
</li>
<li class="covered" data-hits="1" data-linenumber="168">
<span class="hits">1</span>
- <code class="ruby"> it 'has a type' do</code>
+ <code class="ruby"> describe 'has a type' do</code>
</li>
<li class="covered" data-hits="1" data-linenumber="169">
<span class="hits">1</span>
- <code class="ruby"> response = Contentful::Response.new raw_fixture('404_type', 404)</code>
+ <code class="ruby"> it 'type is on the top level' do</code>
</li>
<li class="covered" data-hits="1" data-linenumber="170">
<span class="hits">1</span>
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
+ <code class="ruby"> response = Contentful::Response.new raw_fixture('404_type', 404)</code>
</li>
- <li class="never" data-hits="" data-linenumber="171">
+ <li class="covered" data-hits="1" data-linenumber="171">
+ <span class="hits">1</span>
+ <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="172">
+
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="172">
+ <li class="covered" data-hits="1" data-linenumber="173">
<span class="hits">1</span>
- <code class="ruby"> message = "HTTP status code: 404\n"\</code>
+ <code class="ruby"> message = "HTTP status code: 404\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="173">
+ <li class="never" data-hits="" data-linenumber="174">
- <code class="ruby"> "Message: The requested resource or endpoint could not be found.\n"\</code>
+ <code class="ruby"> "Message: The requested resource or endpoint could not be found.\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="174">
+ <li class="never" data-hits="" data-linenumber="175">
- <code class="ruby"> "Details: The requested Asset could not be found.\n"\</code>
+ <code class="ruby"> "Details: The requested Asset could not be found.\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="175">
+ <li class="never" data-hits="" data-linenumber="176">
- <code class="ruby"> "Request ID: 85f-351076632"</code>
+ <code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="176">
+ <li class="covered" data-hits="1" data-linenumber="177">
<span class="hits">1</span>
- <code class="ruby"> expect(error.message).to eq message</code>
+ <code class="ruby"> expect(error.message).to eq message</code>
</li>
- <li class="never" data-hits="" data-linenumber="177">
+ <li class="never" data-hits="" data-linenumber="178">
+ <code class="ruby"> end</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="179">
+
+
+ <code class="ruby"></code>
+ </li>
+
+ <li class="covered" data-hits="1" data-linenumber="180">
+ <span class="hits">1</span>
+
+ <code class="ruby"> it 'type is not on the top level' do</code>
+ </li>
+
+ <li class="covered" data-hits="1" data-linenumber="181">
+ <span class="hits">1</span>
+
+ <code class="ruby"> response = Contentful::Response.new raw_fixture('404_sys_type', 404)</code>
+ </li>
+
+ <li class="covered" data-hits="1" data-linenumber="182">
+ <span class="hits">1</span>
+
+ <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="183">
+
+
+ <code class="ruby"></code>
+ </li>
+
+ <li class="covered" data-hits="1" data-linenumber="184">
+ <span class="hits">1</span>
+
+ <code class="ruby"> message = "HTTP status code: 404\n"\</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="185">
+
+
+ <code class="ruby"> "Message: The requested resource or endpoint could not be found.\n"\</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="186">
+
+
+ <code class="ruby"> "Details: The requested Space could not be found.\n"\</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="187">
+
+
+ <code class="ruby"> "Request ID: 85f-351076632"</code>
+ </li>
+
+ <li class="covered" data-hits="1" data-linenumber="188">
+ <span class="hits">1</span>
+
+ <code class="ruby"> expect(error.message).to eq message</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="189">
+
+
+ <code class="ruby"> end</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="190">
+
+
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="178">
+ <li class="never" data-hits="" data-linenumber="191">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="179">
+ <li class="covered" data-hits="1" data-linenumber="192">
<span class="hits">1</span>
<code class="ruby"> it 'can specify the resource id' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="180">
+ <li class="covered" data-hits="1" data-linenumber="193">
<span class="hits">1</span>
<code class="ruby"> response = Contentful::Response.new raw_fixture('404_id', 404)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="181">
+ <li class="covered" data-hits="1" data-linenumber="194">
<span class="hits">1</span>
<code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
</li>
- <li class="never" data-hits="" data-linenumber="182">
+ <li class="never" data-hits="" data-linenumber="195">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="183">
+ <li class="covered" data-hits="1" data-linenumber="196">
<span class="hits">1</span>
<code class="ruby"> message = "HTTP status code: 404\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="184">
+ <li class="never" data-hits="" data-linenumber="197">
<code class="ruby"> "Message: The requested resource or endpoint could not be found.\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="185">
+ <li class="never" data-hits="" data-linenumber="198">
<code class="ruby"> "Details: The requested Asset could not be found. ID: foobar.\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="186">
+ <li class="never" data-hits="" data-linenumber="199">
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="187">
+ <li class="covered" data-hits="1" data-linenumber="200">
<span class="hits">1</span>
<code class="ruby"> expect(error.message).to eq message</code>
</li>
- <li class="never" data-hits="" data-linenumber="188">
+ <li class="never" data-hits="" data-linenumber="201">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="189">
+ <li class="never" data-hits="" data-linenumber="202">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="190">
+ <li class="never" data-hits="" data-linenumber="203">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="191">
+ <li class="covered" data-hits="1" data-linenumber="204">
<span class="hits">1</span>
<code class="ruby"> describe '429' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="192">
+ <li class="covered" data-hits="1" data-linenumber="205">
<span class="hits">1</span>
<code class="ruby"> it 'can show the time until reset' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="193">
+ <li class="covered" data-hits="1" data-linenumber="206">
<span class="hits">1</span>
<code class="ruby"> response = Contentful::Response.new raw_fixture('default_429', 429, false, {'x-contentful-ratelimit-reset' => 60})</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="194">
+ <li class="covered" data-hits="1" data-linenumber="207">
<span class="hits">1</span>
<code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
</li>
- <li class="never" data-hits="" data-linenumber="195">
+ <li class="never" data-hits="" data-linenumber="208">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="196">
+ <li class="covered" data-hits="1" data-linenumber="209">
<span class="hits">1</span>
<code class="ruby"> message = "HTTP status code: 429\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="197">
+ <li class="never" data-hits="" data-linenumber="210">
<code class="ruby"> "Message: Rate limit exceeded. Too many requests.\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="198">
+ <li class="never" data-hits="" data-linenumber="211">
<code class="ruby"> "Request ID: 85f-351076632\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="199">
+ <li class="never" data-hits="" data-linenumber="212">
<code class="ruby"> "Time until reset (seconds): 60"</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="200">
+ <li class="covered" data-hits="1" data-linenumber="213">
<span class="hits">1</span>
<code class="ruby"> expect(error.message).to eq message</code>
</li>
- <li class="never" data-hits="" data-linenumber="201">
+ <li class="never" data-hits="" data-linenumber="214">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="202">
+ <li class="never" data-hits="" data-linenumber="215">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="203">
+ <li class="never" data-hits="" data-linenumber="216">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="204">
+ <li class="never" data-hits="" data-linenumber="217">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="205">
+ <li class="covered" data-hits="1" data-linenumber="218">
<span class="hits">1</span>
<code class="ruby"> describe 'generic error' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="206">
+ <li class="covered" data-hits="1" data-linenumber="219">
<span class="hits">1</span>
<code class="ruby"> it 'with everything' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="207">
+ <li class="covered" data-hits="1" data-linenumber="220">
<span class="hits">1</span>
<code class="ruby"> response = Contentful::Response.new raw_fixture('other_error', 512)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="208">
+ <li class="covered" data-hits="1" data-linenumber="221">
<span class="hits">1</span>
<code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
</li>
- <li class="never" data-hits="" data-linenumber="209">
+ <li class="never" data-hits="" data-linenumber="222">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="210">
+ <li class="covered" data-hits="1" data-linenumber="223">
<span class="hits">1</span>
<code class="ruby"> message = "HTTP status code: 512\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="211">
+ <li class="never" data-hits="" data-linenumber="224">
<code class="ruby"> "Message: Some error occurred.\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="212">
+ <li class="never" data-hits="" data-linenumber="225">
<code class="ruby"> "Details: some text\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="213">
+ <li class="never" data-hits="" data-linenumber="226">
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="214">
+ <li class="covered" data-hits="1" data-linenumber="227">
<span class="hits">1</span>
<code class="ruby"> expect(error.message).to eq message</code>
</li>
- <li class="never" data-hits="" data-linenumber="215">
+ <li class="never" data-hits="" data-linenumber="228">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="216">
+ <li class="never" data-hits="" data-linenumber="229">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="217">
+ <li class="covered" data-hits="1" data-linenumber="230">
<span class="hits">1</span>
<code class="ruby"> it 'no details' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="218">
+ <li class="covered" data-hits="1" data-linenumber="231">
<span class="hits">1</span>
<code class="ruby"> response = Contentful::Response.new raw_fixture('other_error_no_details', 512)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="219">
+ <li class="covered" data-hits="1" data-linenumber="232">
<span class="hits">1</span>
<code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
</li>
- <li class="never" data-hits="" data-linenumber="220">
+ <li class="never" data-hits="" data-linenumber="233">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="221">
+ <li class="covered" data-hits="1" data-linenumber="234">
<span class="hits">1</span>
<code class="ruby"> message = "HTTP status code: 512\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="222">
+ <li class="never" data-hits="" data-linenumber="235">
<code class="ruby"> "Message: Some error occurred.\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="223">
+ <li class="never" data-hits="" data-linenumber="236">
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="224">
+ <li class="covered" data-hits="1" data-linenumber="237">
<span class="hits">1</span>
<code class="ruby"> expect(error.message).to eq message</code>
</li>
- <li class="never" data-hits="" data-linenumber="225">
+ <li class="never" data-hits="" data-linenumber="238">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="226">
+ <li class="never" data-hits="" data-linenumber="239">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="227">
+ <li class="covered" data-hits="1" data-linenumber="240">
<span class="hits">1</span>
<code class="ruby"> it 'no request id' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="228">
+ <li class="covered" data-hits="1" data-linenumber="241">
<span class="hits">1</span>
<code class="ruby"> response = Contentful::Response.new raw_fixture('other_error_no_request_id', 512)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="229">
+ <li class="covered" data-hits="1" data-linenumber="242">
<span class="hits">1</span>
<code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
</li>
- <li class="never" data-hits="" data-linenumber="230">
+ <li class="never" data-hits="" data-linenumber="243">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="231">
+ <li class="covered" data-hits="1" data-linenumber="244">
<span class="hits">1</span>
<code class="ruby"> message = "HTTP status code: 512\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="232">
+ <li class="never" data-hits="" data-linenumber="245">
<code class="ruby"> "Message: Some error occurred.\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="233">
+ <li class="never" data-hits="" data-linenumber="246">
<code class="ruby"> "Details: some text"</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="234">
+ <li class="covered" data-hits="1" data-linenumber="247">
<span class="hits">1</span>
<code class="ruby"> expect(error.message).to eq message</code>
</li>
- <li class="never" data-hits="" data-linenumber="235">
+ <li class="never" data-hits="" data-linenumber="248">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="236">
+ <li class="never" data-hits="" data-linenumber="249">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="237">
+ <li class="covered" data-hits="1" data-linenumber="250">
<span class="hits">1</span>
<code class="ruby"> it 'no message' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="238">
+ <li class="covered" data-hits="1" data-linenumber="251">
<span class="hits">1</span>
<code class="ruby"> response = Contentful::Response.new raw_fixture('other_error_no_message', 512)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="239">
+ <li class="covered" data-hits="1" data-linenumber="252">
<span class="hits">1</span>
<code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
</li>
- <li class="never" data-hits="" data-linenumber="240">
+ <li class="never" data-hits="" data-linenumber="253">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="241">
+ <li class="covered" data-hits="1" data-linenumber="254">
<span class="hits">1</span>
<code class="ruby"> message = "HTTP status code: 512\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="242">
+ <li class="never" data-hits="" data-linenumber="255">
<code class="ruby"> "Message: The following error was received: {\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="243">
+ <li class="never" data-hits="" data-linenumber="256">
<code class="ruby"> " \"sys\": {\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="244">
+ <li class="never" data-hits="" data-linenumber="257">
<code class="ruby"> " \"type\": \"Error\",\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="245">
+ <li class="never" data-hits="" data-linenumber="258">
<code class="ruby"> " \"id\": \"SomeError\"\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="246">
+ <li class="never" data-hits="" data-linenumber="259">
<code class="ruby"> " },\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="247">
+ <li class="never" data-hits="" data-linenumber="260">
<code class="ruby"> " \"details\": \"some text\",\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="248">
+ <li class="never" data-hits="" data-linenumber="261">
<code class="ruby"> " \"requestId\": \"85f-351076632\"\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="249">
+ <li class="never" data-hits="" data-linenumber="262">
<code class="ruby"> "}\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="250">
+ <li class="never" data-hits="" data-linenumber="263">
<code class="ruby"> "\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="251">
+ <li class="never" data-hits="" data-linenumber="264">
<code class="ruby"> "Details: some text\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="252">
+ <li class="never" data-hits="" data-linenumber="265">
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="253">
+ <li class="covered" data-hits="1" data-linenumber="266">
<span class="hits">1</span>
<code class="ruby"> expect(error.message).to eq message</code>
</li>
- <li class="never" data-hits="" data-linenumber="254">
+ <li class="never" data-hits="" data-linenumber="267">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="255">
+ <li class="never" data-hits="" data-linenumber="268">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="256">
+ <li class="covered" data-hits="1" data-linenumber="269">
<span class="hits">1</span>
<code class="ruby"> it 'nothing' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="257">
+ <li class="covered" data-hits="1" data-linenumber="270">
<span class="hits">1</span>
<code class="ruby"> response = Contentful::Response.new raw_fixture('other_error_nothing', 512)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="258">
+ <li class="covered" data-hits="1" data-linenumber="271">
<span class="hits">1</span>
<code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
</li>
- <li class="never" data-hits="" data-linenumber="259">
+ <li class="never" data-hits="" data-linenumber="272">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="260">
+ <li class="covered" data-hits="1" data-linenumber="273">
<span class="hits">1</span>
<code class="ruby"> message = "HTTP status code: 512\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="261">
+ <li class="never" data-hits="" data-linenumber="274">
<code class="ruby"> "Message: The following error was received: {\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="262">
+ <li class="never" data-hits="" data-linenumber="275">
<code class="ruby"> " \"sys\": {\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="263">
+ <li class="never" data-hits="" data-linenumber="276">
<code class="ruby"> " \"type\": \"Error\",\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="264">
+ <li class="never" data-hits="" data-linenumber="277">
<code class="ruby"> " \"id\": \"SomeError\"\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="265">
+ <li class="never" data-hits="" data-linenumber="278">
<code class="ruby"> " }\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="266">
+ <li class="never" data-hits="" data-linenumber="279">
<code class="ruby"> "}\n"</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="267">
+ <li class="covered" data-hits="1" data-linenumber="280">
<span class="hits">1</span>
<code class="ruby"> expect(error.message).to eq message</code>
</li>
- <li class="never" data-hits="" data-linenumber="268">
+ <li class="never" data-hits="" data-linenumber="281">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="269">
+ <li class="never" data-hits="" data-linenumber="282">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="270">
+ <li class="never" data-hits="" data-linenumber="283">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="271">
+ <li class="never" data-hits="" data-linenumber="284">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="272">
+ <li class="never" data-hits="" data-linenumber="285">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="273">
+ <li class="covered" data-hits="1" data-linenumber="286">
<span class="hits">1</span>
<code class="ruby"> describe Contentful::UnparsableJson do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="274">
+ <li class="covered" data-hits="1" data-linenumber="287">
<span class="hits">1</span>
<code class="ruby"> describe '#message' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="275">
+ <li class="covered" data-hits="1" data-linenumber="288">
<span class="hits">1</span>
<code class="ruby"> it 'returns the json parser\'s message' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="276">
+ <li class="covered" data-hits="1" data-linenumber="289">
<span class="hits">1</span>
<code class="ruby"> uj = Contentful::Response.new raw_fixture('unparsable')</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="277">
+ <li class="covered" data-hits="1" data-linenumber="290">
<span class="hits">1</span>
<code class="ruby"> expect(Contentful::UnparsableJson.new(uj).message).to \</code>
</li>
- <li class="never" data-hits="" data-linenumber="278">
+ <li class="never" data-hits="" data-linenumber="291">
<code class="ruby"> include 'unexpected token'</code>
</li>
- <li class="never" data-hits="" data-linenumber="279">
+ <li class="never" data-hits="" data-linenumber="292">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="280">
+ <li class="never" data-hits="" data-linenumber="293">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="281">
+ <li class="never" data-hits="" data-linenumber="294">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="282">
+ <li class="never" data-hits="" data-linenumber="295">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="283">
+ <li class="covered" data-hits="1" data-linenumber="296">
<span class="hits">1</span>
<code class="ruby"> describe '.[]' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="284">
+ <li class="covered" data-hits="1" data-linenumber="297">
<span class="hits">1</span>
<code class="ruby"> it 'returns BadRequest error class for 400' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="285">
+ <li class="covered" data-hits="1" data-linenumber="298">
<span class="hits">1</span>
<code class="ruby"> expect(Contentful::Error[400]).to eq Contentful::BadRequest</code>
</li>
- <li class="never" data-hits="" data-linenumber="286">
+ <li class="never" data-hits="" data-linenumber="299">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="287">
+ <li class="never" data-hits="" data-linenumber="300">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="288">
+ <li class="covered" data-hits="1" data-linenumber="301">
<span class="hits">1</span>
<code class="ruby"> it 'returns Unauthorized error class for 401' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="289">
+ <li class="covered" data-hits="1" data-linenumber="302">
<span class="hits">1</span>
<code class="ruby"> expect(Contentful::Error[401]).to eq Contentful::Unauthorized</code>
</li>
- <li class="never" data-hits="" data-linenumber="290">
+ <li class="never" data-hits="" data-linenumber="303">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="291">
+ <li class="never" data-hits="" data-linenumber="304">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="292">
+ <li class="covered" data-hits="1" data-linenumber="305">
<span class="hits">1</span>
<code class="ruby"> it 'returns AccessDenied error class for 403' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="293">
+ <li class="covered" data-hits="1" data-linenumber="306">
<span class="hits">1</span>
<code class="ruby"> expect(Contentful::Error[403]).to eq Contentful::AccessDenied</code>
</li>
- <li class="never" data-hits="" data-linenumber="294">
+ <li class="never" data-hits="" data-linenumber="307">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="295">
+ <li class="never" data-hits="" data-linenumber="308">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="296">
+ <li class="covered" data-hits="1" data-linenumber="309">
<span class="hits">1</span>
<code class="ruby"> it 'returns NotFound error class for 404' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="297">
+ <li class="covered" data-hits="1" data-linenumber="310">
<span class="hits">1</span>
<code class="ruby"> expect(Contentful::Error[404]).to eq Contentful::NotFound</code>
</li>
- <li class="never" data-hits="" data-linenumber="298">
+ <li class="never" data-hits="" data-linenumber="311">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="299">
+ <li class="never" data-hits="" data-linenumber="312">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="300">
+ <li class="covered" data-hits="1" data-linenumber="313">
<span class="hits">1</span>
<code class="ruby"> it 'returns ServerError error class for 500' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="301">
+ <li class="covered" data-hits="1" data-linenumber="314">
<span class="hits">1</span>
<code class="ruby"> expect(Contentful::Error[500]).to eq Contentful::ServerError</code>
</li>
- <li class="never" data-hits="" data-linenumber="302">
+ <li class="never" data-hits="" data-linenumber="315">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="303">
+ <li class="never" data-hits="" data-linenumber="316">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="304">
+ <li class="covered" data-hits="1" data-linenumber="317">
<span class="hits">1</span>
<code class="ruby"> it 'returns ServiceUnavailable error class for 503' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="305">
+ <li class="covered" data-hits="1" data-linenumber="318">
<span class="hits">1</span>
<code class="ruby"> expect(Contentful::Error[503]).to eq Contentful::ServiceUnavailable</code>
</li>
- <li class="never" data-hits="" data-linenumber="306">
+ <li class="never" data-hits="" data-linenumber="319">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="307">
+ <li class="never" data-hits="" data-linenumber="320">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="308">
+ <li class="covered" data-hits="1" data-linenumber="321">
<span class="hits">1</span>
<code class="ruby"> it 'returns generic error class for any other value' do</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="309">
+ <li class="covered" data-hits="1" data-linenumber="322">
<span class="hits">1</span>
<code class="ruby"> expect(Contentful::Error[nil]).to eq Contentful::Error</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="310">
+ <li class="covered" data-hits="1" data-linenumber="323">
<span class="hits">1</span>
<code class="ruby"> expect(Contentful::Error[200]).to eq Contentful::Error</code>
</li>
- <li class="never" data-hits="" data-linenumber="311">
+ <li class="never" data-hits="" data-linenumber="324">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="312">
+ <li class="never" data-hits="" data-linenumber="325">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="313">
+ <li class="never" data-hits="" data-linenumber="326">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="314">
+ <li class="never" data-hits="" data-linenumber="327">
<code class="ruby">end</code>
</li>
@@ -24552,53 +24636,53 @@
<span class="hits">1</span>
<code class="ruby">def raw_fixture(which, status = 200, _as_json = false, headers = {})</code>
</li>
- <li class="covered" data-hits="39" data-linenumber="4">
- <span class="hits">39</span>
+ <li class="covered" data-hits="40" data-linenumber="4">
+ <span class="hits">40</span>
<code class="ruby"> object = Object.new</code>
</li>
- <li class="covered" data-hits="218" data-linenumber="5">
- <span class="hits">218</span>
+ <li class="covered" data-hits="225" data-linenumber="5">
+ <span class="hits">225</span>
<code class="ruby"> allow(object).to receive(:status) { status }</code>
</li>
- <li class="covered" data-hits="121" data-linenumber="6">
- <span class="hits">121</span>
+ <li class="covered" data-hits="125" data-linenumber="6">
+ <span class="hits">125</span>
<code class="ruby"> allow(object).to receive(:headers) { headers }</code>
</li>
- <li class="covered" data-hits="158" data-linenumber="7">
- <span class="hits">158</span>
+ <li class="covered" data-hits="163" data-linenumber="7">
+ <span class="hits">163</span>
<code class="ruby"> allow(object).to receive(:to_s) { File.read File.dirname(__FILE__) + "/../fixtures/json_responses/#{which}.json" }</code>
</li>
- <li class="covered" data-hits="52" data-linenumber="8">
- <span class="hits">52</span>
+ <li class="covered" data-hits="53" data-linenumber="8">
+ <span class="hits">53</span>
<code class="ruby"> allow(object).to receive(:body) { object.to_s }</code>
</li>
- <li class="covered" data-hits="43" data-linenumber="9">
- <span class="hits">43</span>
+ <li class="covered" data-hits="44" data-linenumber="9">
+ <span class="hits">44</span>
<code class="ruby"> allow(object).to receive(:[]) { |key| object.headers[key] }</code>
</li>
<li class="never" data-hits="" data-linenumber="10">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="39" data-linenumber="11">
- <span class="hits">39</span>
+ <li class="covered" data-hits="40" data-linenumber="11">
+ <span class="hits">40</span>
<code class="ruby"> object</code>
</li>
<li class="never" data-hits="" data-linenumber="12">