coverage/index.html in contentful-2.2.0 vs coverage/index.html in contentful-2.2.1
- old
+ new
@@ -12,31 +12,31 @@
<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-24T14:37:07+02:00">2017-10-24T14:37:07+02:00</abbr></div>
+ <div class="timestamp">Generated <abbr class="timeago" title="2017-10-25T11:55:54+02:00">2017-10-25T11:55:54+02: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.86%</span></span>
+ (<span class="covered_percent"><span class="green">98.91%</span></span>
covered at
<span class="covered_strength">
<span class="green">
- 482.52
+ 438.22
</span>
</span> hits/line)
</h2>
<a name="AllFiles"></a>
<div>
<b>50</b> files in total.
- <b>1748</b> relevant lines.
- <span class="green"><b>1728</b> lines covered</span> and
- <span class="red"><b>20</b> lines missed </span>
+ <b>1930</b> relevant lines.
+ <span class="green"><b>1909</b> lines covered</span> and
+ <span class="red"><b>21</b> lines missed </span>
</div>
<table class="file_list">
<thead>
<tr>
<th>File</th>
@@ -100,16 +100,16 @@
<td>5039.8</td>
</tr>
<tr>
<td class="strong"><a href="#b0e31f234acd83c871a193ce29ed6b38e9adc98e" class="src_link" title="lib/contentful/client.rb">lib/contentful/client.rb</a></td>
- <td class="green strong">96.6 %</td>
+ <td class="green strong">96.58 %</td>
<td>418</td>
- <td>147</td>
- <td>142</td>
+ <td>146</td>
+ <td>141</td>
<td>5</td>
- <td>111.9</td>
+ <td>112.6</td>
</tr>
<tr>
<td class="strong"><a href="#beb22ab5c60eaaa44a2cba4f526b8a2630d7a31a" class="src_link" title="lib/contentful/coercions.rb">lib/contentful/coercions.rb</a></td>
<td class="green strong">97.3 %</td>
@@ -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">100.0 %</td>
- <td>201</td>
- <td>25</td>
- <td>25</td>
- <td>0</td>
- <td>4.0</td>
+ <td class="green strong">98.91 %</td>
+ <td>203</td>
+ <td>92</td>
+ <td>91</td>
+ <td>1</td>
+ <td>13.1</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>46.2</td>
+ <td>57.0</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,15 +391,15 @@
</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>303</td>
- <td>31</td>
- <td>31</td>
+ <td>314</td>
+ <td>145</td>
+ <td>145</td>
<td>0</td>
- <td>1.1</td>
+ <td>1.0</td>
</tr>
<tr>
<td class="strong"><a href="#a882eb4cc91a2c1702f2e5743aba55a06bbc06f0" class="src_link" title="spec/error_requests_spec.rb">spec/error_requests_spec.rb</a></td>
<td class="green strong">100.0 %</td>
@@ -512,14 +512,14 @@
<tr>
<td class="strong"><a href="#a4ba320676b73b8644cffc9dbb12bbe8e19a9934" class="src_link" title="spec/support/json_responses.rb">spec/support/json_responses.rb</a></td>
<td class="green strong">100.0 %</td>
<td>18</td>
- <td>9</td>
- <td>9</td>
+ <td>11</td>
+ <td>11</td>
<td>0</td>
- <td>18.0</td>
+ <td>61.3</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>
@@ -2498,14 +2498,14 @@
<div class="source_table" id="b0e31f234acd83c871a193ce29ed6b38e9adc98e">
<div class="header">
<h3>lib/contentful/client.rb</h3>
- <h4><span class="green">96.6 %</span> covered</h4>
+ <h4><span class="green">96.58 %</span> covered</h4>
<div>
- <b>147</b> relevant lines.
- <span class="green"><b>142</b> lines covered</span> and
+ <b>146</b> relevant lines.
+ <span class="green"><b>141</b> lines covered</span> and
<span class="red"><b>5</b> lines missed.</span>
</div>
</div>
<pre>
@@ -2791,61 +2791,61 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="48">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="48">
+
<code class="ruby"> # Wraps the actual HTTP request via proxy</code>
</li>
<li class="never" data-hits="" data-linenumber="49">
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="50">
+ <li class="covered" data-hits="1" data-linenumber="50">
+ <span class="hits">1</span>
-
<code class="ruby"> def self.get_http(url, query, headers = {}, proxy = {})</code>
</li>
- <li class="never" data-hits="" data-linenumber="51">
+ <li class="covered" data-hits="192" data-linenumber="51">
+ <span class="hits">192</span>
-
<code class="ruby"> if proxy[:host]</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="52">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="52">
+
<code class="ruby"> HTTP[headers].via(proxy[:host], proxy[:port], proxy[:username], proxy[:password]).get(url, params: query)</code>
</li>
- <li class="covered" data-hits="192" data-linenumber="53">
- <span class="hits">192</span>
+ <li class="never" data-hits="" data-linenumber="53">
+
<code class="ruby"> else</code>
</li>
- <li class="missed" data-hits="0" data-linenumber="54">
+ <li class="covered" data-hits="192" data-linenumber="54">
+ <span class="hits">192</span>
-
<code class="ruby"> HTTP[headers].get(url, params: query)</code>
</li>
<li class="never" data-hits="" data-linenumber="55">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="192" data-linenumber="56">
- <span class="hits">192</span>
+ <li class="never" data-hits="" data-linenumber="56">
+
<code class="ruby"> end</code>
</li>
<li class="never" data-hits="" data-linenumber="57">
@@ -3013,43 +3013,43 @@
<code class="ruby"> # @option given_configuration [String] :integration_version</code>
</li>
- <li class="never" data-hits="" data-linenumber="85">
+ <li class="covered" data-hits="1" data-linenumber="85">
+ <span class="hits">1</span>
-
<code class="ruby"> def initialize(given_configuration = {})</code>
</li>
- <li class="never" data-hits="" data-linenumber="86">
+ <li class="covered" data-hits="203" data-linenumber="86">
+ <span class="hits">203</span>
-
<code class="ruby"> @configuration = default_configuration.merge(given_configuration)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="87">
- <span class="hits">1</span>
+ <li class="covered" data-hits="203" data-linenumber="87">
+ <span class="hits">203</span>
<code class="ruby"> normalize_configuration!</code>
</li>
<li class="covered" data-hits="203" data-linenumber="88">
<span class="hits">203</span>
<code class="ruby"> validate_configuration!</code>
</li>
- <li class="covered" data-hits="203" data-linenumber="89">
- <span class="hits">203</span>
+ <li class="covered" data-hits="201" data-linenumber="89">
+ <span class="hits">201</span>
<code class="ruby"> setup_logger</code>
</li>
- <li class="covered" data-hits="203" data-linenumber="90">
- <span class="hits">203</span>
+ <li class="never" data-hits="" data-linenumber="90">
+
<code class="ruby"></code>
</li>
<li class="covered" data-hits="201" data-linenumber="91">
<span class="hits">201</span>
@@ -3061,73 +3061,73 @@
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="201" data-linenumber="93">
- <span class="hits">201</span>
+ <li class="never" data-hits="" data-linenumber="93">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="94">
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="95">
+ <li class="covered" data-hits="1" data-linenumber="95">
+ <span class="hits">1</span>
-
<code class="ruby"> def setup_logger</code>
</li>
- <li class="never" data-hits="" data-linenumber="96">
+ <li class="covered" data-hits="201" data-linenumber="96">
+ <span class="hits">201</span>
-
<code class="ruby"> @logger = configuration[:logger]</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="97">
- <span class="hits">1</span>
+ <li class="covered" data-hits="201" data-linenumber="97">
+ <span class="hits">201</span>
<code class="ruby"> logger.level = configuration[:log_level] if logger</code>
</li>
- <li class="covered" data-hits="201" data-linenumber="98">
- <span class="hits">201</span>
+ <li class="never" data-hits="" data-linenumber="98">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="201" data-linenumber="99">
- <span class="hits">201</span>
+ <li class="never" data-hits="" data-linenumber="99">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="100">
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="101">
+ <li class="covered" data-hits="1" data-linenumber="101">
+ <span class="hits">1</span>
-
<code class="ruby"> def proxy_params</code>
</li>
<li class="never" data-hits="" data-linenumber="102">
<code class="ruby"> {</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="103">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="103">
+
<code class="ruby"> host: configuration[:proxy_host],</code>
</li>
<li class="never" data-hits="" data-linenumber="104">
@@ -3145,25 +3145,25 @@
<code class="ruby"> password: configuration[:proxy_password]</code>
</li>
- <li class="never" data-hits="" data-linenumber="107">
+ <li class="covered" data-hits="198" data-linenumber="107">
+ <span class="hits">198</span>
-
<code class="ruby"> }</code>
</li>
<li class="never" data-hits="" data-linenumber="108">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="198" data-linenumber="109">
- <span class="hits">198</span>
+ <li class="never" data-hits="" data-linenumber="109">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="110">
@@ -3175,31 +3175,31 @@
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="112">
+ <li class="covered" data-hits="1" data-linenumber="112">
+ <span class="hits">1</span>
-
<code class="ruby"> def default_configuration</code>
</li>
- <li class="never" data-hits="" data-linenumber="113">
+ <li class="covered" data-hits="203" data-linenumber="113">
+ <span class="hits">203</span>
-
<code class="ruby"> DEFAULT_CONFIGURATION.dup</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="114">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="114">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="203" data-linenumber="115">
- <span class="hits">203</span>
+ <li class="never" data-hits="" data-linenumber="115">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="116">
@@ -3229,31 +3229,31 @@
<code class="ruby"> # @return [Contentful::Space]</code>
</li>
- <li class="never" data-hits="" data-linenumber="121">
+ <li class="covered" data-hits="1" data-linenumber="121">
+ <span class="hits">1</span>
-
<code class="ruby"> def space(query = {})</code>
</li>
- <li class="never" data-hits="" data-linenumber="122">
+ <li class="covered" data-hits="9" data-linenumber="122">
+ <span class="hits">9</span>
-
<code class="ruby"> Request.new(self, '', query).get</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="123">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="123">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="9" data-linenumber="124">
- <span class="hits">9</span>
+ <li class="never" data-hits="" data-linenumber="124">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="125">
@@ -3289,31 +3289,31 @@
<code class="ruby"> # @return [Contentful::ContentType]</code>
</li>
- <li class="never" data-hits="" data-linenumber="131">
+ <li class="covered" data-hits="1" data-linenumber="131">
+ <span class="hits">1</span>
-
<code class="ruby"> def content_type(id, query = {})</code>
</li>
- <li class="never" data-hits="" data-linenumber="132">
+ <li class="covered" data-hits="23" data-linenumber="132">
+ <span class="hits">23</span>
-
<code class="ruby"> Request.new(self, '/content_types', query, id).get</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="133">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="133">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="23" data-linenumber="134">
- <span class="hits">23</span>
+ <li class="never" data-hits="" data-linenumber="134">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="135">
@@ -3343,31 +3343,31 @@
<code class="ruby"> # @return [Contentful::Array<Contentful::ContentType>]</code>
</li>
- <li class="never" data-hits="" data-linenumber="140">
+ <li class="covered" data-hits="1" data-linenumber="140">
+ <span class="hits">1</span>
-
<code class="ruby"> def content_types(query = {})</code>
</li>
- <li class="never" data-hits="" data-linenumber="141">
+ <li class="covered" data-hits="25" data-linenumber="141">
+ <span class="hits">25</span>
-
<code class="ruby"> Request.new(self, '/content_types', query).get</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="142">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="142">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="25" data-linenumber="143">
- <span class="hits">25</span>
+ <li class="never" data-hits="" data-linenumber="143">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="144">
@@ -3403,67 +3403,67 @@
<code class="ruby"> # @return [Contentful::Entry]</code>
</li>
- <li class="never" data-hits="" data-linenumber="150">
+ <li class="covered" data-hits="1" data-linenumber="150">
+ <span class="hits">1</span>
-
<code class="ruby"> def entry(id, query = {})</code>
</li>
- <li class="never" data-hits="" data-linenumber="151">
+ <li class="covered" data-hits="32" data-linenumber="151">
+ <span class="hits">32</span>
-
<code class="ruby"> normalize_select!(query)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="152">
- <span class="hits">1</span>
+ <li class="covered" data-hits="32" data-linenumber="152">
+ <span class="hits">32</span>
<code class="ruby"> query['sys.id'] = id</code>
</li>
<li class="covered" data-hits="32" data-linenumber="153">
<span class="hits">32</span>
<code class="ruby"> entries = Request.new(self, '/entries', query).get</code>
</li>
- <li class="covered" data-hits="32" data-linenumber="154">
- <span class="hits">32</span>
+ <li class="never" data-hits="" data-linenumber="154">
+
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="32" data-linenumber="155">
- <span class="hits">32</span>
+ <li class="covered" data-hits="29" data-linenumber="155">
+ <span class="hits">29</span>
<code class="ruby"> return entries if configuration[:raw_mode]</code>
</li>
<li class="never" data-hits="" data-linenumber="156">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="29" data-linenumber="157">
- <span class="hits">29</span>
+ <li class="covered" data-hits="28" data-linenumber="157">
+ <span class="hits">28</span>
<code class="ruby"> entries.first</code>
</li>
<li class="never" data-hits="" data-linenumber="158">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="28" data-linenumber="159">
- <span class="hits">28</span>
+ <li class="never" data-hits="" data-linenumber="159">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="160">
@@ -3493,37 +3493,37 @@
<code class="ruby"> # @return [Contentful::Array<Contentful::Entry>]</code>
</li>
- <li class="never" data-hits="" data-linenumber="165">
+ <li class="covered" data-hits="1" data-linenumber="165">
+ <span class="hits">1</span>
-
<code class="ruby"> def entries(query = {})</code>
</li>
- <li class="never" data-hits="" data-linenumber="166">
+ <li class="covered" data-hits="19" data-linenumber="166">
+ <span class="hits">19</span>
-
<code class="ruby"> normalize_select!(query)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="167">
- <span class="hits">1</span>
+ <li class="covered" data-hits="19" data-linenumber="167">
+ <span class="hits">19</span>
<code class="ruby"> Request.new(self, '/entries', query).get</code>
</li>
- <li class="covered" data-hits="19" data-linenumber="168">
- <span class="hits">19</span>
+ <li class="never" data-hits="" data-linenumber="168">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="19" data-linenumber="169">
- <span class="hits">19</span>
+ <li class="never" data-hits="" data-linenumber="169">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="170">
@@ -3559,31 +3559,31 @@
<code class="ruby"> # @return [Contentful::Asset]</code>
</li>
- <li class="never" data-hits="" data-linenumber="176">
+ <li class="covered" data-hits="1" data-linenumber="176">
+ <span class="hits">1</span>
-
<code class="ruby"> def asset(id, query = {})</code>
</li>
- <li class="never" data-hits="" data-linenumber="177">
+ <li class="covered" data-hits="22" data-linenumber="177">
+ <span class="hits">22</span>
-
<code class="ruby"> Request.new(self, '/assets', query, id).get</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="178">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="178">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="22" data-linenumber="179">
- <span class="hits">22</span>
+ <li class="never" data-hits="" data-linenumber="179">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="180">
@@ -3613,37 +3613,37 @@
<code class="ruby"> # @return [Contentful::Array<Contentful::Asset>]</code>
</li>
- <li class="never" data-hits="" data-linenumber="185">
+ <li class="covered" data-hits="1" data-linenumber="185">
+ <span class="hits">1</span>
-
<code class="ruby"> def assets(query = {})</code>
</li>
- <li class="never" data-hits="" data-linenumber="186">
+ <li class="covered" data-hits="9" data-linenumber="186">
+ <span class="hits">9</span>
-
<code class="ruby"> normalize_select!(query)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="187">
- <span class="hits">1</span>
+ <li class="covered" data-hits="9" data-linenumber="187">
+ <span class="hits">9</span>
<code class="ruby"> Request.new(self, '/assets', query).get</code>
</li>
- <li class="covered" data-hits="9" data-linenumber="188">
- <span class="hits">9</span>
+ <li class="never" data-hits="" data-linenumber="188">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="9" data-linenumber="189">
- <span class="hits">9</span>
+ <li class="never" data-hits="" data-linenumber="189">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="190">
@@ -3655,31 +3655,31 @@
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="192">
+ <li class="covered" data-hits="1" data-linenumber="192">
+ <span class="hits">1</span>
-
<code class="ruby"> def base_url</code>
</li>
- <li class="never" data-hits="" data-linenumber="193">
+ <li class="covered" data-hits="182" data-linenumber="193">
+ <span class="hits">182</span>
-
<code class="ruby"> "http#{configuration[:secure] ? 's' : ''}://#{configuration[:api_url]}/spaces/#{configuration[:space]}"</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="194">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="194">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="182" data-linenumber="195">
- <span class="hits">182</span>
+ <li class="never" data-hits="" data-linenumber="195">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="196">
@@ -3691,43 +3691,43 @@
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="198">
+ <li class="covered" data-hits="1" data-linenumber="198">
+ <span class="hits">1</span>
-
<code class="ruby"> def format_user_agent_header(key, values)</code>
</li>
- <li class="never" data-hits="" data-linenumber="199">
+ <li class="covered" data-hits="750" data-linenumber="199">
+ <span class="hits">750</span>
-
<code class="ruby"> header = "#{key} #{values[:name]}"</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="200">
- <span class="hits">1</span>
+ <li class="covered" data-hits="750" data-linenumber="200">
+ <span class="hits">750</span>
<code class="ruby"> header = "#{header}/#{values[:version]}" if values[:version]</code>
</li>
<li class="covered" data-hits="750" data-linenumber="201">
<span class="hits">750</span>
<code class="ruby"> "#{header};"</code>
</li>
- <li class="covered" data-hits="750" data-linenumber="202">
- <span class="hits">750</span>
+ <li class="never" data-hits="" data-linenumber="202">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="750" data-linenumber="203">
- <span class="hits">750</span>
+ <li class="never" data-hits="" data-linenumber="203">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="204">
@@ -3739,31 +3739,31 @@
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="206">
+ <li class="covered" data-hits="1" data-linenumber="206">
+ <span class="hits">1</span>
-
<code class="ruby"> def sdk_info</code>
</li>
- <li class="never" data-hits="" data-linenumber="207">
+ <li class="covered" data-hits="240" data-linenumber="207">
+ <span class="hits">240</span>
-
<code class="ruby"> { name: 'contentful.rb', version: ::Contentful::VERSION }</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="208">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="208">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="240" data-linenumber="209">
- <span class="hits">240</span>
+ <li class="never" data-hits="" data-linenumber="209">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="210">
@@ -3775,31 +3775,31 @@
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="212">
+ <li class="covered" data-hits="1" data-linenumber="212">
+ <span class="hits">1</span>
-
<code class="ruby"> def app_info</code>
</li>
- <li class="never" data-hits="" data-linenumber="213">
+ <li class="covered" data-hits="240" data-linenumber="213">
+ <span class="hits">240</span>
-
<code class="ruby"> { name: configuration[:application_name], version: configuration[:application_version] }</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="214">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="214">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="240" data-linenumber="215">
- <span class="hits">240</span>
+ <li class="never" data-hits="" data-linenumber="215">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="216">
@@ -3811,31 +3811,31 @@
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="218">
+ <li class="covered" data-hits="1" data-linenumber="218">
+ <span class="hits">1</span>
-
<code class="ruby"> def integration_info</code>
</li>
- <li class="never" data-hits="" data-linenumber="219">
+ <li class="covered" data-hits="240" data-linenumber="219">
+ <span class="hits">240</span>
-
<code class="ruby"> { name: configuration[:integration_name], version: configuration[:integration_version] }</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="220">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="220">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="240" data-linenumber="221">
- <span class="hits">240</span>
+ <li class="never" data-hits="" data-linenumber="221">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="222">
@@ -3847,31 +3847,31 @@
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="224">
+ <li class="covered" data-hits="1" data-linenumber="224">
+ <span class="hits">1</span>
-
<code class="ruby"> def platform_info</code>
</li>
- <li class="never" data-hits="" data-linenumber="225">
+ <li class="covered" data-hits="240" data-linenumber="225">
+ <span class="hits">240</span>
-
<code class="ruby"> { name: 'ruby', version: RUBY_VERSION }</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="226">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="226">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="240" data-linenumber="227">
- <span class="hits">240</span>
+ <li class="never" data-hits="" data-linenumber="227">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="228">
@@ -3883,25 +3883,25 @@
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="230">
+ <li class="covered" data-hits="1" data-linenumber="230">
+ <span class="hits">1</span>
-
<code class="ruby"> def os_info</code>
</li>
- <li class="never" data-hits="" data-linenumber="231">
+ <li class="covered" data-hits="240" data-linenumber="231">
+ <span class="hits">240</span>
-
<code class="ruby"> os_name = case ::RbConfig::CONFIG['host_os']</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="232">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="232">
+
<code class="ruby"> when /(cygwin|mingw|mswin|windows)/i then 'Windows'</code>
</li>
<li class="covered" data-hits="240" data-linenumber="233">
<span class="hits">240</span>
@@ -3913,31 +3913,31 @@
<code class="ruby"> when /(linux|bsd|aix|solarix)/i then 'Linux'</code>
</li>
- <li class="covered" data-hits="240" data-linenumber="235">
- <span class="hits">240</span>
+ <li class="never" data-hits="" data-linenumber="235">
+
<code class="ruby"> end</code>
</li>
- <li class="missed" data-hits="0" data-linenumber="236">
+ <li class="covered" data-hits="240" data-linenumber="236">
+ <span class="hits">240</span>
-
<code class="ruby"> { name: os_name, version: Gem::Platform.local.version }</code>
</li>
<li class="never" data-hits="" data-linenumber="237">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="240" data-linenumber="238">
- <span class="hits">240</span>
+ <li class="never" data-hits="" data-linenumber="238">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="239">
@@ -3949,31 +3949,31 @@
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="241">
+ <li class="covered" data-hits="1" data-linenumber="241">
+ <span class="hits">1</span>
-
<code class="ruby"> def contentful_user_agent</code>
</li>
- <li class="never" data-hits="" data-linenumber="242">
+ <li class="covered" data-hits="240" data-linenumber="242">
+ <span class="hits">240</span>
-
<code class="ruby"> header = {</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="243">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="243">
+
<code class="ruby"> 'sdk' => sdk_info,</code>
</li>
- <li class="covered" data-hits="240" data-linenumber="244">
- <span class="hits">240</span>
+ <li class="never" data-hits="" data-linenumber="244">
+
<code class="ruby"> 'app' => app_info,</code>
</li>
<li class="never" data-hits="" data-linenumber="245">
@@ -4003,55 +4003,55 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="250">
+ <li class="covered" data-hits="240" data-linenumber="250">
+ <span class="hits">240</span>
-
<code class="ruby"> result = []</code>
</li>
- <li class="never" data-hits="" data-linenumber="251">
+ <li class="covered" data-hits="240" data-linenumber="251">
+ <span class="hits">240</span>
-
<code class="ruby"> header.each do |key, values|</code>
</li>
- <li class="covered" data-hits="240" data-linenumber="252">
- <span class="hits">240</span>
+ <li class="covered" data-hits="1200" data-linenumber="252">
+ <span class="hits">1200</span>
<code class="ruby"> next unless values[:name]</code>
</li>
- <li class="covered" data-hits="240" data-linenumber="253">
- <span class="hits">240</span>
+ <li class="covered" data-hits="750" data-linenumber="253">
+ <span class="hits">750</span>
<code class="ruby"> result << format_user_agent_header(key, values)</code>
</li>
- <li class="covered" data-hits="1200" data-linenumber="254">
- <span class="hits">1200</span>
+ <li class="never" data-hits="" data-linenumber="254">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="750" data-linenumber="255">
- <span class="hits">750</span>
+ <li class="covered" data-hits="240" data-linenumber="255">
+ <span class="hits">240</span>
<code class="ruby"> result.join(' ')</code>
</li>
<li class="never" data-hits="" data-linenumber="256">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="240" data-linenumber="257">
- <span class="hits">240</span>
+ <li class="never" data-hits="" data-linenumber="257">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="258">
@@ -4063,24 +4063,24 @@
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="260">
+ <li class="covered" data-hits="1" data-linenumber="260">
+ <span class="hits">1</span>
-
<code class="ruby"> def request_headers</code>
</li>
- <li class="never" data-hits="" data-linenumber="261">
+ <li class="covered" data-hits="204" data-linenumber="261">
+ <span class="hits">204</span>
-
<code class="ruby"> headers = { 'X-Contentful-User-Agent' => contentful_user_agent }</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="262">
- <span class="hits">1</span>
+ <li class="covered" data-hits="204" data-linenumber="262">
+ <span class="hits">204</span>
<code class="ruby"> headers['Authorization'] = "Bearer #{configuration[:access_token]}" if configuration[:authentication_mechanism] == :header</code>
</li>
<li class="covered" data-hits="204" data-linenumber="263">
@@ -4099,19 +4099,19 @@
<span class="hits">204</span>
<code class="ruby"> headers</code>
</li>
- <li class="covered" data-hits="204" data-linenumber="266">
- <span class="hits">204</span>
+ <li class="never" data-hits="" data-linenumber="266">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="204" data-linenumber="267">
- <span class="hits">204</span>
+ <li class="never" data-hits="" data-linenumber="267">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="268">
@@ -4123,49 +4123,49 @@
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="270">
+ <li class="covered" data-hits="1" data-linenumber="270">
+ <span class="hits">1</span>
-
<code class="ruby"> def request_query(query)</code>
</li>
- <li class="never" data-hits="" data-linenumber="271">
+ <li class="covered" data-hits="196" data-linenumber="271">
+ <span class="hits">196</span>
-
<code class="ruby"> if configuration[:authentication_mechanism] == :query_string</code>
</li>
<li class="covered" data-hits="1" data-linenumber="272">
<span class="hits">1</span>
<code class="ruby"> query['access_token'] = configuration[:access_token]</code>
</li>
- <li class="covered" data-hits="196" data-linenumber="273">
- <span class="hits">196</span>
+ <li class="never" data-hits="" data-linenumber="273">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="274">
- <span class="hits">1</span>
+ <li class="covered" data-hits="196" data-linenumber="274">
+ <span class="hits">196</span>
<code class="ruby"> query</code>
</li>
<li class="never" data-hits="" data-linenumber="275">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="196" data-linenumber="276">
- <span class="hits">196</span>
+ <li class="never" data-hits="" data-linenumber="276">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="277">
@@ -4195,43 +4195,43 @@
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="282">
+ <li class="covered" data-hits="1" data-linenumber="282">
+ <span class="hits">1</span>
-
<code class="ruby"> def get(request, build_resource = true)</code>
</li>
- <li class="never" data-hits="" data-linenumber="283">
+ <li class="covered" data-hits="193" data-linenumber="283">
+ <span class="hits">193</span>
-
<code class="ruby"> retries_left = configuration[:max_rate_limit_retries]</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="284">
- <span class="hits">1</span>
+ <li class="covered" data-hits="193" data-linenumber="284">
+ <span class="hits">193</span>
<code class="ruby"> result = nil</code>
</li>
<li class="covered" data-hits="193" data-linenumber="285">
<span class="hits">193</span>
<code class="ruby"> begin</code>
</li>
- <li class="covered" data-hits="193" data-linenumber="286">
- <span class="hits">193</span>
+ <li class="covered" data-hits="194" data-linenumber="286">
+ <span class="hits">194</span>
<code class="ruby"> response = run_request(request)</code>
</li>
- <li class="covered" data-hits="193" data-linenumber="287">
- <span class="hits">193</span>
+ <li class="never" data-hits="" data-linenumber="287">
+
<code class="ruby"></code>
</li>
<li class="covered" data-hits="194" data-linenumber="288">
<span class="hits">194</span>
@@ -4243,72 +4243,72 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="194" data-linenumber="290">
- <span class="hits">194</span>
+ <li class="covered" data-hits="189" data-linenumber="290">
+ <span class="hits">189</span>
<code class="ruby"> return fail_response(response) if response.status != :ok</code>
</li>
<li class="never" data-hits="" data-linenumber="291">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="189" data-linenumber="292">
- <span class="hits">189</span>
+ <li class="covered" data-hits="180" data-linenumber="292">
+ <span class="hits">180</span>
<code class="ruby"> result = do_build_resource(response)</code>
</li>
<li class="never" data-hits="" data-linenumber="293">
<code class="ruby"> rescue UnparsableResource => error</code>
</li>
- <li class="covered" data-hits="180" data-linenumber="294">
- <span class="hits">180</span>
+ <li class="missed" data-hits="0" data-linenumber="294">
+
<code class="ruby"> raise error if configuration[:raise_errors]</code>
</li>
- <li class="never" data-hits="" data-linenumber="295">
+ <li class="missed" data-hits="0" data-linenumber="295">
<code class="ruby"> return error</code>
</li>
- <li class="missed" data-hits="0" data-linenumber="296">
+ <li class="never" data-hits="" data-linenumber="296">
<code class="ruby"> rescue Contentful::RateLimitExceeded => rate_limit_error</code>
</li>
- <li class="missed" data-hits="0" data-linenumber="297">
+ <li class="covered" data-hits="2" data-linenumber="297">
+ <span class="hits">2</span>
-
<code class="ruby"> reset_time = rate_limit_error.reset_time.to_i</code>
</li>
- <li class="never" data-hits="" data-linenumber="298">
+ <li class="covered" data-hits="2" data-linenumber="298">
+ <span class="hits">2</span>
-
<code class="ruby"> if should_retry(retries_left, reset_time, configuration[:max_rate_limit_wait])</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="299">
- <span class="hits">2</span>
+ <li class="covered" data-hits="1" data-linenumber="299">
+ <span class="hits">1</span>
<code class="ruby"> retries_left -= 1</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="300">
- <span class="hits">2</span>
+ <li class="covered" data-hits="1" data-linenumber="300">
+ <span class="hits">1</span>
<code class="ruby"> logger.info(retry_message(retries_left, reset_time)) if logger</code>
</li>
<li class="covered" data-hits="1" data-linenumber="301">
@@ -4321,73 +4321,73 @@
<span class="hits">1</span>
<code class="ruby"> retry</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="303">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="303">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="304">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="304">
+
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="305">
+ <li class="covered" data-hits="1" data-linenumber="305">
+ <span class="hits">1</span>
-
<code class="ruby"> raise</code>
</li>
<li class="never" data-hits="" data-linenumber="306">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="307">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="307">
+
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="308">
+ <li class="covered" data-hits="180" data-linenumber="308">
+ <span class="hits">180</span>
-
<code class="ruby"> result</code>
</li>
<li class="never" data-hits="" data-linenumber="309">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="180" data-linenumber="310">
- <span class="hits">180</span>
+ <li class="never" data-hits="" data-linenumber="310">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="311">
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="312">
+ <li class="covered" data-hits="1" data-linenumber="312">
+ <span class="hits">1</span>
-
<code class="ruby"> def retry_message(retries_left, reset_time)</code>
</li>
- <li class="never" data-hits="" data-linenumber="313">
+ <li class="covered" data-hits="1" data-linenumber="313">
+ <span class="hits">1</span>
-
<code class="ruby"> message = 'Contentful API Rate Limit Hit! '</code>
</li>
<li class="covered" data-hits="1" data-linenumber="314">
<span class="hits">1</span>
@@ -4405,85 +4405,85 @@
<span class="hits">1</span>
<code class="ruby"> message</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="317">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="317">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="318">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="318">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="319">
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="320">
+ <li class="covered" data-hits="1" data-linenumber="320">
+ <span class="hits">1</span>
-
<code class="ruby"> def fail_response(response)</code>
</li>
- <li class="never" data-hits="" data-linenumber="321">
+ <li class="covered" data-hits="9" data-linenumber="321">
+ <span class="hits">9</span>
-
<code class="ruby"> fail response.object if configuration[:raise_errors]</code>
</li>
<li class="covered" data-hits="1" data-linenumber="322">
<span class="hits">1</span>
<code class="ruby"> response.object</code>
</li>
- <li class="covered" data-hits="9" data-linenumber="323">
- <span class="hits">9</span>
+ <li class="never" data-hits="" data-linenumber="323">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="324">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="324">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="325">
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="326">
+ <li class="covered" data-hits="1" data-linenumber="326">
+ <span class="hits">1</span>
-
<code class="ruby"> def should_retry(retries_left, reset_time, max_wait)</code>
</li>
- <li class="never" data-hits="" data-linenumber="327">
+ <li class="covered" data-hits="2" data-linenumber="327">
+ <span class="hits">2</span>
-
<code class="ruby"> retries_left > 0 && max_wait > reset_time</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="328">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="328">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="329">
- <span class="hits">2</span>
+ <li class="never" data-hits="" data-linenumber="329">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="330">
@@ -4495,43 +4495,43 @@
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="332">
+ <li class="covered" data-hits="1" data-linenumber="332">
+ <span class="hits">1</span>
-
<code class="ruby"> def run_request(request)</code>
</li>
- <li class="never" data-hits="" data-linenumber="333">
+ <li class="covered" data-hits="194" data-linenumber="333">
+ <span class="hits">194</span>
-
<code class="ruby"> url = request.absolute? ? request.url : base_url + request.url</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="334">
- <span class="hits">1</span>
+ <li class="covered" data-hits="194" data-linenumber="334">
+ <span class="hits">194</span>
<code class="ruby"> logger.info(request: { url: url, query: request.query, header: request_headers }) if logger</code>
</li>
<li class="covered" data-hits="194" data-linenumber="335">
<span class="hits">194</span>
<code class="ruby"> Response.new(</code>
</li>
- <li class="covered" data-hits="194" data-linenumber="336">
- <span class="hits">194</span>
+ <li class="never" data-hits="" data-linenumber="336">
+
<code class="ruby"> self.class.get_http(</code>
</li>
- <li class="covered" data-hits="194" data-linenumber="337">
- <span class="hits">194</span>
+ <li class="never" data-hits="" data-linenumber="337">
+
<code class="ruby"> url,</code>
</li>
<li class="never" data-hits="" data-linenumber="338">
@@ -4585,73 +4585,73 @@
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="347">
+ <li class="covered" data-hits="1" data-linenumber="347">
+ <span class="hits">1</span>
-
<code class="ruby"> def do_build_resource(response)</code>
</li>
- <li class="never" data-hits="" data-linenumber="348">
+ <li class="covered" data-hits="180" data-linenumber="348">
+ <span class="hits">180</span>
-
<code class="ruby"> logger.debug(response: response) if logger</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="349">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="349">
+
<code class="ruby"> configuration[:resource_builder].new(</code>
</li>
- <li class="covered" data-hits="180" data-linenumber="350">
- <span class="hits">180</span>
+ <li class="never" data-hits="" data-linenumber="350">
+
<code class="ruby"> response.object,</code>
</li>
<li class="never" data-hits="" data-linenumber="351">
<code class="ruby"> configuration,</code>
</li>
- <li class="never" data-hits="" data-linenumber="352">
+ <li class="covered" data-hits="180" data-linenumber="352">
+ <span class="hits">180</span>
-
<code class="ruby"> (response.request.query || {}).fetch(:locale, nil) == '*',</code>
</li>
<li class="never" data-hits="" data-linenumber="353">
<code class="ruby"> 0,</code>
</li>
- <li class="covered" data-hits="180" data-linenumber="354">
- <span class="hits">180</span>
+ <li class="never" data-hits="" data-linenumber="354">
+
<code class="ruby"> response.request.endpoint</code>
</li>
- <li class="never" data-hits="" data-linenumber="355">
+ <li class="covered" data-hits="180" data-linenumber="355">
+ <span class="hits">180</span>
-
<code class="ruby"> ).run</code>
</li>
<li class="never" data-hits="" data-linenumber="356">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="180" data-linenumber="357">
- <span class="hits">180</span>
+ <li class="never" data-hits="" data-linenumber="357">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="358">
@@ -4669,37 +4669,37 @@
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="361">
+ <li class="covered" data-hits="1" data-linenumber="361">
+ <span class="hits">1</span>
-
<code class="ruby"> def update_dynamic_entry_cache!</code>
</li>
- <li class="never" data-hits="" data-linenumber="362">
+ <li class="covered" data-hits="14" data-linenumber="362">
+ <span class="hits">14</span>
-
<code class="ruby"> content_types(limit: 1000).map do |ct|</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="363">
- <span class="hits">1</span>
+ <li class="covered" data-hits="28" data-linenumber="363">
+ <span class="hits">28</span>
<code class="ruby"> ContentTypeCache.cache_set(configuration[:space], ct.id, ct)</code>
</li>
- <li class="covered" data-hits="14" data-linenumber="364">
- <span class="hits">14</span>
+ <li class="never" data-hits="" data-linenumber="364">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="28" data-linenumber="365">
- <span class="hits">28</span>
+ <li class="never" data-hits="" data-linenumber="365">
+
<code class="ruby"> end</code>
</li>
<li class="never" data-hits="" data-linenumber="366">
@@ -4723,31 +4723,31 @@
<code class="ruby"> # @private</code>
</li>
- <li class="never" data-hits="" data-linenumber="370">
+ <li class="covered" data-hits="1" data-linenumber="370">
+ <span class="hits">1</span>
-
<code class="ruby"> def register_dynamic_entry(key, klass)</code>
</li>
- <li class="never" data-hits="" data-linenumber="371">
+ <li class="covered" data-hits="1" data-linenumber="371">
+ <span class="hits">1</span>
-
<code class="ruby"> ContentTypeCache.cache_set(configuration[:space], key, klass)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="372">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="372">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="373">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="373">
+
<code class="ruby"></code>
</li>
<li class="never" data-hits="" data-linenumber="374">
@@ -4789,49 +4789,49 @@
<code class="ruby"> # @return [Contentful::Sync]</code>
</li>
- <li class="never" data-hits="" data-linenumber="381">
+ <li class="covered" data-hits="1" data-linenumber="381">
+ <span class="hits">1</span>
-
<code class="ruby"> def sync(options = { initial: true })</code>
</li>
- <li class="never" data-hits="" data-linenumber="382">
+ <li class="covered" data-hits="42" data-linenumber="382">
+ <span class="hits">42</span>
-
<code class="ruby"> Sync.new(self, options)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="383">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="383">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="42" data-linenumber="384">
- <span class="hits">42</span>
+ <li class="never" data-hits="" data-linenumber="384">
+
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="385">
+ <li class="covered" data-hits="1" data-linenumber="385">
+ <span class="hits">1</span>
-
<code class="ruby"> private</code>
</li>
<li class="never" data-hits="" data-linenumber="386">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="387">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="387">
+
<code class="ruby"> # If the query contains the :select operator, we enforce :sys properties.</code>
</li>
<li class="never" data-hits="" data-linenumber="388">
@@ -4849,114 +4849,114 @@
<code class="ruby"> # include the complete :sys block to provide consistency accross our SDKs.</code>
</li>
- <li class="never" data-hits="" data-linenumber="391">
+ <li class="covered" data-hits="1" data-linenumber="391">
+ <span class="hits">1</span>
-
<code class="ruby"> def normalize_select!(query)</code>
</li>
- <li class="never" data-hits="" data-linenumber="392">
+ <li class="covered" data-hits="60" data-linenumber="392">
+ <span class="hits">60</span>
-
<code class="ruby"> return unless query.key?(:select)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="393">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="393">
+
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="60" data-linenumber="394">
- <span class="hits">60</span>
+ <li class="covered" data-hits="9" data-linenumber="394">
+ <span class="hits">9</span>
<code class="ruby"> query[:select] = query[:select].split(',').map(&:strip) if query[:select].is_a? String</code>
</li>
- <li class="never" data-hits="" data-linenumber="395">
+ <li class="covered" data-hits="19" data-linenumber="395">
+ <span class="hits">19</span>
-
<code class="ruby"> query[:select] = query[:select].reject { |p| p.start_with?('sys.') }</code>
</li>
<li class="covered" data-hits="9" data-linenumber="396">
<span class="hits">9</span>
<code class="ruby"> query[:select] << 'sys' unless query[:select].include?('sys')</code>
</li>
- <li class="covered" data-hits="19" data-linenumber="397">
- <span class="hits">19</span>
+ <li class="never" data-hits="" data-linenumber="397">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="9" data-linenumber="398">
- <span class="hits">9</span>
+ <li class="never" data-hits="" data-linenumber="398">
+
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="399">
+ <li class="covered" data-hits="1" data-linenumber="399">
+ <span class="hits">1</span>
-
<code class="ruby"> def normalize_configuration!</code>
</li>
- <li class="never" data-hits="" data-linenumber="400">
+ <li class="covered" data-hits="1015" data-linenumber="400">
+ <span class="hits">1015</span>
-
<code class="ruby"> [:space, :access_token, :api_url, :default_locale].each { |s| configuration[s] = configuration[s].to_s }</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="401">
- <span class="hits">1</span>
+ <li class="covered" data-hits="203" data-linenumber="401">
+ <span class="hits">203</span>
<code class="ruby"> configuration[:authentication_mechanism] = configuration[:authentication_mechanism].to_sym</code>
</li>
- <li class="covered" data-hits="1015" data-linenumber="402">
- <span class="hits">1015</span>
+ <li class="never" data-hits="" data-linenumber="402">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="203" data-linenumber="403">
- <span class="hits">203</span>
+ <li class="never" data-hits="" data-linenumber="403">
+
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="404">
+ <li class="covered" data-hits="1" data-linenumber="404">
+ <span class="hits">1</span>
-
<code class="ruby"> def validate_configuration!</code>
</li>
- <li class="never" data-hits="" data-linenumber="405">
+ <li class="covered" data-hits="203" data-linenumber="405">
+ <span class="hits">203</span>
-
<code class="ruby"> fail ArgumentError, 'You will need to initialize a client with a :space' if configuration[:space].empty?</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="406">
- <span class="hits">1</span>
+ <li class="covered" data-hits="202" data-linenumber="406">
+ <span class="hits">202</span>
<code class="ruby"> fail ArgumentError, 'You will need to initialize a client with an :access_token' if configuration[:access_token].empty?</code>
</li>
- <li class="covered" data-hits="203" data-linenumber="407">
- <span class="hits">203</span>
+ <li class="covered" data-hits="201" data-linenumber="407">
+ <span class="hits">201</span>
<code class="ruby"> fail ArgumentError, 'The client configuration needs to contain an :api_url' if configuration[:api_url].empty?</code>
</li>
- <li class="covered" data-hits="202" data-linenumber="408">
- <span class="hits">202</span>
+ <li class="covered" data-hits="201" data-linenumber="408">
+ <span class="hits">201</span>
<code class="ruby"> fail ArgumentError, 'The client configuration needs to contain a :default_locale' if configuration[:default_locale].empty?</code>
</li>
<li class="covered" data-hits="201" data-linenumber="409">
@@ -4969,37 +4969,37 @@
<span class="hits">201</span>
<code class="ruby"> fail ArgumentError, 'The authentication mechanism must be :header or :query_string' unless [:header, :query_string].include?(</code>
</li>
- <li class="covered" data-hits="201" data-linenumber="411">
- <span class="hits">201</span>
+ <li class="never" data-hits="" data-linenumber="411">
+
<code class="ruby"> configuration[:authentication_mechanism]</code>
</li>
- <li class="covered" data-hits="201" data-linenumber="412">
- <span class="hits">201</span>
+ <li class="never" data-hits="" data-linenumber="412">
+
<code class="ruby"> )</code>
</li>
- <li class="never" data-hits="" data-linenumber="413">
+ <li class="covered" data-hits="201" data-linenumber="413">
+ <span class="hits">201</span>
-
<code class="ruby"> fail ArgumentError, 'The :dynamic_entries mode must be :auto or :manual' unless [:auto, :manual].include?(</code>
</li>
<li class="never" data-hits="" data-linenumber="414">
<code class="ruby"> configuration[:dynamic_entries]</code>
</li>
- <li class="covered" data-hits="201" data-linenumber="415">
- <span class="hits">201</span>
+ <li class="never" data-hits="" data-linenumber="415">
+
<code class="ruby"> )</code>
</li>
<li class="never" data-hits="" data-linenumber="416">
@@ -6663,15 +6663,15 @@
<div class="source_table" id="98433a4cac96676bcf6b420f480c3d946ae0d0cb">
<div class="header">
<h3>lib/contentful/error.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
+ <h4><span class="green">98.91 %</span> covered</h4>
<div>
- <b>25</b> relevant lines.
- <span class="green"><b>25</b> lines covered</span> and
- <span class="red"><b>0</b> lines missed.</span>
+ <b>92</b> relevant lines.
+ <span class="green"><b>91</b> lines covered</span> and
+ <span class="red"><b>1</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -6716,18 +6716,18 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(response)</code>
</li>
- <li class="covered" data-hits="21" data-linenumber="8">
- <span class="hits">21</span>
+ <li class="covered" data-hits="63" data-linenumber="8">
+ <span class="hits">63</span>
<code class="ruby"> @response = response</code>
</li>
- <li class="covered" data-hits="21" data-linenumber="9">
- <span class="hits">21</span>
+ <li class="covered" data-hits="63" data-linenumber="9">
+ <span class="hits">63</span>
<code class="ruby"> super best_available_message</code>
</li>
<li class="never" data-hits="" data-linenumber="10">
@@ -6758,115 +6758,115 @@
<span class="hits">1</span>
<code class="ruby"> def self.[](error_status_code)</code>
</li>
- <li class="covered" data-hits="22" data-linenumber="15">
- <span class="hits">22</span>
+ <li class="covered" data-hits="64" data-linenumber="15">
+ <span class="hits">64</span>
<code class="ruby"> errors = {</code>
</li>
<li class="never" data-hits="" data-linenumber="16">
<code class="ruby"> 400 => BadRequest,</code>
</li>
- <li class="covered" data-hits="8" data-linenumber="17">
- <span class="hits">8</span>
+ <li class="never" data-hits="" data-linenumber="17">
+
<code class="ruby"> 401 => Unauthorized,</code>
</li>
<li class="never" data-hits="" data-linenumber="18">
<code class="ruby"> 403 => AccessDenied,</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="19">
- <span class="hits">3</span>
+ <li class="never" data-hits="" data-linenumber="19">
+
<code class="ruby"> 404 => NotFound,</code>
</li>
<li class="never" data-hits="" data-linenumber="20">
<code class="ruby"> 429 => RateLimitExceeded,</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="21">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="21">
+
<code class="ruby"> 500 => ServerError,</code>
</li>
<li class="never" data-hits="" data-linenumber="22">
<code class="ruby"> 502 => BadGateway,</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="23">
- <span class="hits">2</span>
+ <li class="never" data-hits="" data-linenumber="23">
+
<code class="ruby"> 503 => ServiceUnavailable</code>
</li>
<li class="never" data-hits="" data-linenumber="24">
<code class="ruby"> }</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="25">
- <span class="hits">2</span>
+ <li class="never" data-hits="" data-linenumber="25">
+
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="26">
+ <li class="covered" data-hits="64" data-linenumber="26">
+ <span class="hits">64</span>
-
<code class="ruby"> errors.key?(error_status_code) ? errors[error_status_code] : Error</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="27">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="27">
+
<code class="ruby"> end</code>
</li>
<li class="never" data-hits="" data-linenumber="28">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="3" data-linenumber="29">
- <span class="hits">3</span>
+ <li class="covered" data-hits="1" data-linenumber="29">
+ <span class="hits">1</span>
<code class="ruby"> protected</code>
</li>
<li class="never" data-hits="" data-linenumber="30">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="2" data-linenumber="31">
- <span class="hits">2</span>
+ <li class="covered" data-hits="1" data-linenumber="31">
+ <span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="never" data-hits="" data-linenumber="32">
+ <li class="covered" data-hits="13" data-linenumber="32">
+ <span class="hits">13</span>
-
<code class="ruby"> "The following error was received: #{@response.raw.body}"</code>
</li>
<li class="never" data-hits="" data-linenumber="33">
@@ -6878,42 +6878,42 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="35">
+ <li class="covered" data-hits="1" data-linenumber="35">
+ <span class="hits">1</span>
-
<code class="ruby"> def handle_details(details)</code>
</li>
- <li class="never" data-hits="" data-linenumber="36">
+ <li class="covered" data-hits="10" data-linenumber="36">
+ <span class="hits">10</span>
-
<code class="ruby"> details.to_s</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="37">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="37">
+
<code class="ruby"> end</code>
</li>
<li class="never" data-hits="" data-linenumber="38">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="39">
+ <li class="covered" data-hits="1" data-linenumber="39">
+ <span class="hits">1</span>
-
<code class="ruby"> def additional_info?</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="40">
- <span class="hits">1</span>
+ <li class="covered" data-hits="57" data-linenumber="40">
+ <span class="hits">57</span>
<code class="ruby"> false</code>
</li>
<li class="never" data-hits="" data-linenumber="41">
@@ -6932,11 +6932,11 @@
<span class="hits">1</span>
<code class="ruby"> def additional_info</code>
</li>
- <li class="never" data-hits="" data-linenumber="44">
+ <li class="missed" data-hits="0" data-linenumber="44">
<code class="ruby"> []</code>
</li>
@@ -6944,31 +6944,31 @@
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="46">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="46">
+
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="47">
+ <li class="covered" data-hits="1" data-linenumber="47">
+ <span class="hits">1</span>
-
<code class="ruby"> def best_available_message</code>
</li>
- <li class="never" data-hits="" data-linenumber="48">
+ <li class="covered" data-hits="63" data-linenumber="48">
+ <span class="hits">63</span>
-
<code class="ruby"> error_message = [</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="49">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="49">
+
<code class="ruby"> "HTTP status code: #{@response.raw.status}"</code>
</li>
<li class="never" data-hits="" data-linenumber="50">
@@ -6980,73 +6980,73 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="52">
- <span class="hits">1</span>
+ <li class="covered" data-hits="63" data-linenumber="52">
+ <span class="hits">63</span>
<code class="ruby"> begin</code>
</li>
- <li class="never" data-hits="" data-linenumber="53">
+ <li class="covered" data-hits="63" data-linenumber="53">
+ <span class="hits">63</span>
-
<code class="ruby"> response_json = @response.load_json</code>
</li>
- <li class="never" data-hits="" data-linenumber="54">
+ <li class="covered" data-hits="59" data-linenumber="54">
+ <span class="hits">59</span>
-
<code class="ruby"> message = response_json.fetch('message', default_error_message)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="55">
- <span class="hits">1</span>
+ <li class="covered" data-hits="59" data-linenumber="55">
+ <span class="hits">59</span>
<code class="ruby"> details = response_json.fetch('details', nil)</code>
</li>
- <li class="never" data-hits="" data-linenumber="56">
+ <li class="covered" data-hits="59" data-linenumber="56">
+ <span class="hits">59</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="1" data-linenumber="58">
- <span class="hits">1</span>
+ <li class="covered" data-hits="59" data-linenumber="58">
+ <span class="hits">59</span>
<code class="ruby"> error_message << "Message: #{message}"</code>
</li>
- <li class="never" data-hits="" data-linenumber="59">
+ <li class="covered" data-hits="59" data-linenumber="59">
+ <span class="hits">59</span>
-
<code class="ruby"> error_message << "Details: #{handle_details(details)}" if details</code>
</li>
- <li class="never" data-hits="" data-linenumber="60">
+ <li class="covered" data-hits="59" data-linenumber="60">
+ <span class="hits">59</span>
-
<code class="ruby"> error_message << "Request ID: #{request_id}" if request_id</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="61">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="61">
+
<code class="ruby"> rescue</code>
</li>
- <li class="never" data-hits="" data-linenumber="62">
+ <li class="covered" data-hits="4" data-linenumber="62">
+ <span class="hits">4</span>
-
<code class="ruby"> error_message << "Message: #{default_error_message}"</code>
</li>
<li class="never" data-hits="" data-linenumber="63">
@@ -7058,25 +7058,25 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="65">
+ <li class="covered" data-hits="63" data-linenumber="65">
+ <span class="hits">63</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="never" data-hits="" data-linenumber="67">
+ <li class="covered" data-hits="63" data-linenumber="67">
+ <span class="hits">63</span>
-
<code class="ruby"> error_message.join("\n")</code>
</li>
<li class="never" data-hits="" data-linenumber="68">
@@ -7100,37 +7100,37 @@
<code class="ruby"> # 400</code>
</li>
- <li class="never" data-hits="" data-linenumber="72">
+ <li class="covered" data-hits="1" data-linenumber="72">
+ <span class="hits">1</span>
-
<code class="ruby"> class BadRequest < Error</code>
</li>
- <li class="never" data-hits="" data-linenumber="73">
+ <li class="covered" data-hits="1" data-linenumber="73">
+ <span class="hits">1</span>
-
<code class="ruby"> protected</code>
</li>
<li class="never" data-hits="" data-linenumber="74">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="75">
+ <li class="covered" data-hits="1" data-linenumber="75">
+ <span class="hits">1</span>
-
<code class="ruby"> def default_error_message</code>
</li>
- <li class="never" data-hits="" data-linenumber="76">
+ <li class="covered" data-hits="10" data-linenumber="76">
+ <span class="hits">10</span>
-
<code class="ruby"> 'The request was malformed or missing a required parameter.'</code>
</li>
<li class="never" data-hits="" data-linenumber="77">
@@ -7142,43 +7142,43 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="79">
+ <li class="covered" data-hits="1" data-linenumber="79">
+ <span class="hits">1</span>
-
<code class="ruby"> def handle_details(details)</code>
</li>
- <li class="never" data-hits="" data-linenumber="80">
+ <li class="covered" data-hits="7" data-linenumber="80">
+ <span class="hits">7</span>
-
<code class="ruby"> return details if details.is_a?(String)</code>
</li>
<li class="never" data-hits="" data-linenumber="81">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="82">
+ <li class="covered" data-hits="5" data-linenumber="82">
+ <span class="hits">5</span>
-
<code class="ruby"> handle_detail = proc do |detail|</code>
</li>
- <li class="never" data-hits="" data-linenumber="83">
+ <li class="covered" data-hits="5" data-linenumber="83">
+ <span class="hits">5</span>
-
<code class="ruby"> return detail if detail.is_a?(String)</code>
</li>
- <li class="never" data-hits="" data-linenumber="84">
+ <li class="covered" data-hits="3" data-linenumber="84">
+ <span class="hits">3</span>
-
<code class="ruby"> detail.fetch('details', nil)</code>
</li>
<li class="never" data-hits="" data-linenumber="85">
@@ -7190,19 +7190,19 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="87">
+ <li class="covered" data-hits="10" data-linenumber="87">
+ <span class="hits">10</span>
-
<code class="ruby"> inner_details = details['errors'].map { |detail| handle_detail[detail] }.reject(&:nil?)</code>
</li>
- <li class="never" data-hits="" data-linenumber="88">
+ <li class="covered" data-hits="3" data-linenumber="88">
+ <span class="hits">3</span>
-
<code class="ruby"> inner_details.join("\n\t")</code>
</li>
<li class="never" data-hits="" data-linenumber="89">
@@ -7226,37 +7226,37 @@
<code class="ruby"> # 401</code>
</li>
- <li class="never" data-hits="" data-linenumber="93">
+ <li class="covered" data-hits="1" data-linenumber="93">
+ <span class="hits">1</span>
-
<code class="ruby"> class Unauthorized < Error</code>
</li>
- <li class="never" data-hits="" data-linenumber="94">
+ <li class="covered" data-hits="1" data-linenumber="94">
+ <span class="hits">1</span>
-
<code class="ruby"> protected</code>
</li>
<li class="never" data-hits="" data-linenumber="95">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="96">
+ <li class="covered" data-hits="1" data-linenumber="96">
+ <span class="hits">1</span>
-
<code class="ruby"> def default_error_message</code>
</li>
- <li class="never" data-hits="" data-linenumber="97">
+ <li class="covered" data-hits="3" data-linenumber="97">
+ <span class="hits">3</span>
-
<code class="ruby"> 'The authorization token was invalid.'</code>
</li>
<li class="never" data-hits="" data-linenumber="98">
@@ -7280,37 +7280,37 @@
<code class="ruby"> # 403</code>
</li>
- <li class="never" data-hits="" data-linenumber="102">
+ <li class="covered" data-hits="1" data-linenumber="102">
+ <span class="hits">1</span>
-
<code class="ruby"> class AccessDenied < Error</code>
</li>
- <li class="never" data-hits="" data-linenumber="103">
+ <li class="covered" data-hits="1" data-linenumber="103">
+ <span class="hits">1</span>
-
<code class="ruby"> protected</code>
</li>
<li class="never" data-hits="" data-linenumber="104">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="105">
+ <li class="covered" data-hits="1" data-linenumber="105">
+ <span class="hits">1</span>
-
<code class="ruby"> def default_error_message</code>
</li>
- <li class="never" data-hits="" data-linenumber="106">
+ <li class="covered" data-hits="4" data-linenumber="106">
+ <span class="hits">4</span>
-
<code class="ruby"> 'The specified token does not have access to the requested resource.'</code>
</li>
<li class="never" data-hits="" data-linenumber="107">
@@ -7322,19 +7322,19 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="109">
+ <li class="covered" data-hits="1" data-linenumber="109">
+ <span class="hits">1</span>
-
<code class="ruby"> def handle_details(details)</code>
</li>
- <li class="never" data-hits="" data-linenumber="110">
+ <li class="covered" data-hits="2" data-linenumber="110">
+ <span class="hits">2</span>
-
<code class="ruby"> "\n\tReasons:\n\t\t#{details['reasons'].join("\n\t\t")}"</code>
</li>
<li class="never" data-hits="" data-linenumber="111">
@@ -7358,37 +7358,37 @@
<code class="ruby"> # 404</code>
</li>
- <li class="never" data-hits="" data-linenumber="115">
+ <li class="covered" data-hits="1" data-linenumber="115">
+ <span class="hits">1</span>
-
<code class="ruby"> class NotFound < Error</code>
</li>
- <li class="never" data-hits="" data-linenumber="116">
+ <li class="covered" data-hits="1" data-linenumber="116">
+ <span class="hits">1</span>
-
<code class="ruby"> protected</code>
</li>
<li class="never" data-hits="" data-linenumber="117">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="118">
+ <li class="covered" data-hits="1" data-linenumber="118">
+ <span class="hits">1</span>
-
<code class="ruby"> def default_error_message</code>
</li>
- <li class="never" data-hits="" data-linenumber="119">
+ <li class="covered" data-hits="15" data-linenumber="119">
+ <span class="hits">15</span>
-
<code class="ruby"> 'The requested resource or endpoint could not be found.'</code>
</li>
<li class="never" data-hits="" data-linenumber="120">
@@ -7400,485 +7400,497 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="122">
+ <li class="covered" data-hits="1" data-linenumber="122">
+ <span class="hits">1</span>
-
<code class="ruby"> def handle_details(details)</code>
</li>
- <li class="never" data-hits="" data-linenumber="123">
+ <li class="covered" data-hits="10" data-linenumber="123">
+ <span class="hits">10</span>
-
- <code class="ruby"> message = "The requested #{details['type']} could not be found."</code>
+ <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="never" data-hits="" data-linenumber="125">
+ <li class="covered" data-hits="8" data-linenumber="125">
+ <span class="hits">8</span>
-
- <code class="ruby"> resource_id = details.fetch('id', nil)</code>
+ <code class="ruby"> message = "The requested #{details['type']} could not be found."</code>
</li>
<li class="never" data-hits="" data-linenumber="126">
+ <code class="ruby"></code>
+ </li>
+
+ <li class="covered" data-hits="8" data-linenumber="127">
+ <span class="hits">8</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>
+
<code class="ruby"> message += " ID: #{resource_id}." if resource_id</code>
</li>
- <li class="never" data-hits="" data-linenumber="127">
+ <li class="never" data-hits="" data-linenumber="129">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="128">
+ <li class="covered" data-hits="8" data-linenumber="130">
+ <span class="hits">8</span>
-
<code class="ruby"> message</code>
</li>
- <li class="never" data-hits="" data-linenumber="129">
+ <li class="never" data-hits="" data-linenumber="131">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="130">
+ <li class="never" data-hits="" data-linenumber="132">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="131">
+ <li class="never" data-hits="" data-linenumber="133">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="132">
+ <li class="never" data-hits="" data-linenumber="134">
<code class="ruby"> # 429</code>
</li>
- <li class="never" data-hits="" data-linenumber="133">
+ <li class="covered" data-hits="1" data-linenumber="135">
+ <span class="hits">1</span>
-
<code class="ruby"> class RateLimitExceeded < Error</code>
</li>
- <li class="never" data-hits="" data-linenumber="134">
+ <li class="never" data-hits="" data-linenumber="136">
<code class="ruby"> # Rate Limit Reset Header Key</code>
</li>
- <li class="never" data-hits="" data-linenumber="135">
+ <li class="covered" data-hits="1" data-linenumber="137">
+ <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="136">
+ <li class="never" data-hits="" data-linenumber="138">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="137">
+ <li class="covered" data-hits="1" data-linenumber="139">
+ <span class="hits">1</span>
-
<code class="ruby"> def reset_time?</code>
</li>
- <li class="never" data-hits="" data-linenumber="138">
+ <li class="never" data-hits="" data-linenumber="140">
<code class="ruby"> # rubocop:disable Style/DoubleNegation</code>
</li>
- <li class="never" data-hits="" data-linenumber="139">
+ <li class="covered" data-hits="6" data-linenumber="141">
+ <span class="hits">6</span>
-
<code class="ruby"> !!reset_time</code>
</li>
- <li class="never" data-hits="" data-linenumber="140">
+ <li class="never" data-hits="" data-linenumber="142">
<code class="ruby"> # rubocop:enable Style/DoubleNegation</code>
</li>
- <li class="never" data-hits="" data-linenumber="141">
+ <li class="never" data-hits="" data-linenumber="143">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="142">
+ <li class="never" data-hits="" data-linenumber="144">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="143">
+ <li class="never" data-hits="" data-linenumber="145">
<code class="ruby"> # Time until next available request, in seconds.</code>
</li>
- <li class="never" data-hits="" data-linenumber="144">
+ <li class="covered" data-hits="1" data-linenumber="146">
+ <span class="hits">1</span>
-
<code class="ruby"> def reset_time</code>
</li>
- <li class="never" data-hits="" data-linenumber="145">
+ <li class="covered" data-hits="11" data-linenumber="147">
+ <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="146">
+ <li class="never" data-hits="" data-linenumber="148">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="147">
+ <li class="never" data-hits="" data-linenumber="149">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="148">
+ <li class="covered" data-hits="1" data-linenumber="150">
+ <span class="hits">1</span>
-
<code class="ruby"> protected</code>
</li>
- <li class="never" data-hits="" data-linenumber="149">
+ <li class="never" data-hits="" data-linenumber="151">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="150">
+ <li class="covered" data-hits="1" data-linenumber="152">
+ <span class="hits">1</span>
-
<code class="ruby"> def additional_info?</code>
</li>
- <li class="never" data-hits="" data-linenumber="151">
+ <li class="covered" data-hits="6" data-linenumber="153">
+ <span class="hits">6</span>
-
<code class="ruby"> reset_time?</code>
</li>
- <li class="never" data-hits="" data-linenumber="152">
+ <li class="never" data-hits="" data-linenumber="154">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="153">
+ <li class="never" data-hits="" data-linenumber="155">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="154">
+ <li class="covered" data-hits="1" data-linenumber="156">
+ <span class="hits">1</span>
-
<code class="ruby"> def additional_info</code>
</li>
- <li class="never" data-hits="" data-linenumber="155">
+ <li class="covered" data-hits="3" data-linenumber="157">
+ <span class="hits">3</span>
-
<code class="ruby"> ["Time until reset (seconds): #{reset_time}"]</code>
</li>
- <li class="never" data-hits="" data-linenumber="156">
+ <li class="never" data-hits="" data-linenumber="158">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="157">
+ <li class="never" data-hits="" data-linenumber="159">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="158">
+ <li class="covered" data-hits="1" data-linenumber="160">
+ <span class="hits">1</span>
-
<code class="ruby"> def default_error_message</code>
</li>
- <li class="never" data-hits="" data-linenumber="159">
+ <li class="covered" data-hits="6" data-linenumber="161">
+ <span class="hits">6</span>
-
<code class="ruby"> 'Rate limit exceeded. Too many requests.'</code>
</li>
- <li class="never" data-hits="" data-linenumber="160">
+ <li class="never" data-hits="" data-linenumber="162">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="161">
+ <li class="never" data-hits="" data-linenumber="163">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="162">
+ <li class="never" data-hits="" data-linenumber="164">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="163">
+ <li class="never" data-hits="" data-linenumber="165">
<code class="ruby"> # 500</code>
</li>
- <li class="never" data-hits="" data-linenumber="164">
+ <li class="covered" data-hits="1" data-linenumber="166">
+ <span class="hits">1</span>
-
<code class="ruby"> class ServerError < Error</code>
</li>
- <li class="never" data-hits="" data-linenumber="165">
+ <li class="covered" data-hits="1" data-linenumber="167">
+ <span class="hits">1</span>
-
<code class="ruby"> protected</code>
</li>
- <li class="never" data-hits="" data-linenumber="166">
+ <li class="never" data-hits="" data-linenumber="168">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="167">
+ <li class="covered" data-hits="1" data-linenumber="169">
+ <span class="hits">1</span>
-
<code class="ruby"> def default_error_message</code>
</li>
- <li class="never" data-hits="" data-linenumber="168">
+ <li class="covered" data-hits="2" data-linenumber="170">
+ <span class="hits">2</span>
-
<code class="ruby"> 'Internal server error.'</code>
</li>
- <li class="never" data-hits="" data-linenumber="169">
+ <li class="never" data-hits="" data-linenumber="171">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="170">
+ <li class="never" data-hits="" data-linenumber="172">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="171">
+ <li class="never" data-hits="" data-linenumber="173">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="172">
+ <li class="never" data-hits="" data-linenumber="174">
<code class="ruby"> # 502</code>
</li>
- <li class="never" data-hits="" data-linenumber="173">
+ <li class="covered" data-hits="1" data-linenumber="175">
+ <span class="hits">1</span>
-
<code class="ruby"> class BadGateway < Error</code>
</li>
- <li class="never" data-hits="" data-linenumber="174">
+ <li class="covered" data-hits="1" data-linenumber="176">
+ <span class="hits">1</span>
-
<code class="ruby"> protected</code>
</li>
- <li class="never" data-hits="" data-linenumber="175">
+ <li class="never" data-hits="" data-linenumber="177">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="176">
+ <li class="covered" data-hits="1" data-linenumber="178">
+ <span class="hits">1</span>
-
<code class="ruby"> def default_error_message</code>
</li>
- <li class="never" data-hits="" data-linenumber="177">
+ <li class="covered" data-hits="2" data-linenumber="179">
+ <span class="hits">2</span>
-
<code class="ruby"> 'The requested space is hibernated.'</code>
</li>
- <li class="never" data-hits="" data-linenumber="178">
+ <li class="never" data-hits="" data-linenumber="180">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="179">
+ <li class="never" data-hits="" data-linenumber="181">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="180">
+ <li class="never" data-hits="" data-linenumber="182">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="181">
+ <li class="never" data-hits="" data-linenumber="183">
<code class="ruby"> # 503</code>
</li>
- <li class="never" data-hits="" data-linenumber="182">
+ <li class="covered" data-hits="1" data-linenumber="184">
+ <span class="hits">1</span>
-
<code class="ruby"> class ServiceUnavailable < Error</code>
</li>
- <li class="never" data-hits="" data-linenumber="183">
+ <li class="covered" data-hits="1" data-linenumber="185">
+ <span class="hits">1</span>
-
<code class="ruby"> protected</code>
</li>
- <li class="never" data-hits="" data-linenumber="184">
+ <li class="never" data-hits="" data-linenumber="186">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="185">
+ <li class="covered" data-hits="1" data-linenumber="187">
+ <span class="hits">1</span>
-
<code class="ruby"> def default_error_message</code>
</li>
- <li class="never" data-hits="" data-linenumber="186">
+ <li class="covered" data-hits="4" data-linenumber="188">
+ <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="187">
+ <li class="never" data-hits="" data-linenumber="189">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="188">
+ <li class="never" data-hits="" data-linenumber="190">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="189">
+ <li class="never" data-hits="" data-linenumber="191">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="190">
+ <li class="never" data-hits="" data-linenumber="192">
<code class="ruby"> # Raised when response is no valid json</code>
</li>
- <li class="never" data-hits="" data-linenumber="191">
+ <li class="covered" data-hits="1" data-linenumber="193">
+ <span class="hits">1</span>
-
<code class="ruby"> class UnparsableJson < Error</code>
</li>
- <li class="never" data-hits="" data-linenumber="192">
+ <li class="covered" data-hits="1" data-linenumber="194">
+ <span class="hits">1</span>
-
<code class="ruby"> protected</code>
</li>
- <li class="never" data-hits="" data-linenumber="193">
+ <li class="never" data-hits="" data-linenumber="195">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="194">
+ <li class="covered" data-hits="1" data-linenumber="196">
+ <span class="hits">1</span>
-
<code class="ruby"> def default_error_message</code>
</li>
- <li class="never" data-hits="" data-linenumber="195">
+ <li class="covered" data-hits="4" data-linenumber="197">
+ <span class="hits">4</span>
-
<code class="ruby"> @response.error_message</code>
</li>
- <li class="never" data-hits="" data-linenumber="196">
+ <li class="never" data-hits="" data-linenumber="198">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="197">
+ <li class="never" data-hits="" data-linenumber="199">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="198">
+ <li class="never" data-hits="" data-linenumber="200">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="199">
+ <li class="never" data-hits="" data-linenumber="201">
<code class="ruby"> # Raised when response is not parsable as a Contentful::Resource</code>
</li>
- <li class="never" data-hits="" data-linenumber="200">
+ <li class="covered" data-hits="1" data-linenumber="202">
+ <span class="hits">1</span>
-
<code class="ruby"> class UnparsableResource < StandardError; end</code>
</li>
- <li class="never" data-hits="" data-linenumber="201">
+ <li class="never" data-hits="" data-linenumber="203">
<code class="ruby">end</code>
</li>
@@ -10799,90 +10811,90 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(raw, request = nil)</code>
</li>
- <li class="covered" data-hits="210" data-linenumber="27">
- <span class="hits">210</span>
+ <li class="covered" data-hits="231" data-linenumber="27">
+ <span class="hits">231</span>
<code class="ruby"> @raw = raw</code>
</li>
- <li class="covered" data-hits="210" data-linenumber="28">
- <span class="hits">210</span>
+ <li class="covered" data-hits="231" data-linenumber="28">
+ <span class="hits">231</span>
<code class="ruby"> @request = request</code>
</li>
- <li class="covered" data-hits="210" data-linenumber="29">
- <span class="hits">210</span>
+ <li class="covered" data-hits="231" data-linenumber="29">
+ <span class="hits">231</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="210" data-linenumber="31">
- <span class="hits">210</span>
+ <li class="covered" data-hits="231" data-linenumber="31">
+ <span class="hits">231</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="15" data-linenumber="33">
- <span class="hits">15</span>
+ <li class="covered" data-hits="36" data-linenumber="33">
+ <span class="hits">36</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="14" data-linenumber="35">
- <span class="hits">14</span>
+ <li class="covered" data-hits="35" data-linenumber="35">
+ <span class="hits">35</span>
<code class="ruby"> elsif invalid_response?</code>
</li>
- <li class="covered" data-hits="9" data-linenumber="36">
- <span class="hits">9</span>
+ <li class="covered" data-hits="17" data-linenumber="36">
+ <span class="hits">17</span>
<code class="ruby"> parse_contentful_error</code>
</li>
- <li class="covered" data-hits="5" data-linenumber="37">
- <span class="hits">5</span>
+ <li class="covered" data-hits="18" data-linenumber="37">
+ <span class="hits">18</span>
<code class="ruby"> elsif service_unavailable_response?</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="38">
- <span class="hits">2</span>
+ <li class="covered" data-hits="3" data-linenumber="38">
+ <span class="hits">3</span>
<code class="ruby"> service_unavailable_error</code>
</li>
<li class="never" data-hits="" data-linenumber="39">
<code class="ruby"> else</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="40">
- <span class="hits">3</span>
+ <li class="covered" data-hits="15" data-linenumber="40">
+ <span class="hits">15</span>
<code class="ruby"> parse_http_error</code>
</li>
<li class="never" data-hits="" data-linenumber="41">
@@ -10901,180 +10913,180 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="44">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="44">
+
<code class="ruby"> # Returns the JSON body of the response</code>
</li>
- <li class="never" data-hits="" data-linenumber="45">
+ <li class="covered" data-hits="1" data-linenumber="45">
+ <span class="hits">1</span>
-
<code class="ruby"> def load_json</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="46">
- <span class="hits">1</span>
+ <li class="covered" data-hits="275" data-linenumber="46">
+ <span class="hits">275</span>
<code class="ruby"> MultiJson.load(unzip_response(raw))</code>
</li>
- <li class="covered" data-hits="9" data-linenumber="47">
- <span class="hits">9</span>
+ <li class="never" data-hits="" data-linenumber="47">
+
<code class="ruby"> end</code>
</li>
<li class="never" data-hits="" data-linenumber="48">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="49">
+ <li class="covered" data-hits="1" data-linenumber="49">
+ <span class="hits">1</span>
-
<code class="ruby"> private</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="50">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="50">
+
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="9" data-linenumber="51">
- <span class="hits">9</span>
+ <li class="covered" data-hits="1" data-linenumber="51">
+ <span class="hits">1</span>
<code class="ruby"> def error_object?</code>
</li>
- <li class="covered" data-hits="9" data-linenumber="52">
- <span class="hits">9</span>
+ <li class="covered" data-hits="17" data-linenumber="52">
+ <span class="hits">17</span>
<code class="ruby"> object['sys']['type'] == 'Error'</code>
</li>
- <li class="covered" data-hits="9" data-linenumber="53">
- <span class="hits">9</span>
+ <li class="never" data-hits="" data-linenumber="53">
+
<code class="ruby"> end</code>
</li>
<li class="never" data-hits="" data-linenumber="54">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="55">
+ <li class="covered" data-hits="1" data-linenumber="55">
+ <span class="hits">1</span>
-
<code class="ruby"> def parse_contentful_error</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="56">
- <span class="hits">1</span>
+ <li class="covered" data-hits="17" data-linenumber="56">
+ <span class="hits">17</span>
<code class="ruby"> @object = load_json</code>
</li>
- <li class="covered" data-hits="210" data-linenumber="57">
- <span class="hits">210</span>
+ <li class="covered" data-hits="17" data-linenumber="57">
+ <span class="hits">17</span>
<code class="ruby"> @error_message = object['message'] if error_object?</code>
</li>
- <li class="never" data-hits="" data-linenumber="58">
+ <li class="covered" data-hits="17" data-linenumber="58">
+ <span class="hits">17</span>
-
<code class="ruby"> parse_http_error</code>
</li>
<li class="never" data-hits="" data-linenumber="59">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="60">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="60">
+
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="5" data-linenumber="61">
- <span class="hits">5</span>
+ <li class="covered" data-hits="1" data-linenumber="61">
+ <span class="hits">1</span>
<code class="ruby"> def valid_http_response?</code>
</li>
- <li class="never" data-hits="" data-linenumber="62">
+ <li class="covered" data-hits="231" data-linenumber="62">
+ <span class="hits">231</span>
-
<code class="ruby"> [200, 201].include?(raw.status)</code>
</li>
<li class="never" data-hits="" data-linenumber="63">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="64">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="64">
+
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="2" data-linenumber="65">
- <span class="hits">2</span>
+ <li class="covered" data-hits="1" data-linenumber="65">
+ <span class="hits">1</span>
<code class="ruby"> def service_unavailable_response?</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="66">
- <span class="hits">2</span>
+ <li class="covered" data-hits="18" data-linenumber="66">
+ <span class="hits">18</span>
<code class="ruby"> @raw.status == 503</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="67">
- <span class="hits">2</span>
+ <li class="never" data-hits="" data-linenumber="67">
+
<code class="ruby"> end</code>
</li>
<li class="never" data-hits="" data-linenumber="68">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="69">
+ <li class="covered" data-hits="1" data-linenumber="69">
+ <span class="hits">1</span>
-
<code class="ruby"> def service_unavailable_error</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="70">
- <span class="hits">1</span>
+ <li class="covered" data-hits="3" data-linenumber="70">
+ <span class="hits">3</span>
<code class="ruby"> @status = :error</code>
</li>
- <li class="covered" data-hits="12" data-linenumber="71">
- <span class="hits">12</span>
+ <li class="covered" data-hits="3" data-linenumber="71">
+ <span class="hits">3</span>
<code class="ruby"> @error_message = '503 - Service Unavailable'</code>
</li>
- <li class="covered" data-hits="12" data-linenumber="72">
- <span class="hits">12</span>
+ <li class="covered" data-hits="3" data-linenumber="72">
+ <span class="hits">3</span>
<code class="ruby"> @object = Error[@raw.status].new(self)</code>
</li>
<li class="never" data-hits="" data-linenumber="73">
@@ -11093,144 +11105,144 @@
<span class="hits">1</span>
<code class="ruby"> def parse_http_error</code>
</li>
- <li class="covered" data-hits="14" data-linenumber="76">
- <span class="hits">14</span>
+ <li class="covered" data-hits="32" data-linenumber="76">
+ <span class="hits">32</span>
<code class="ruby"> @status = :error</code>
</li>
- <li class="never" data-hits="" data-linenumber="77">
+ <li class="covered" data-hits="32" data-linenumber="77">
+ <span class="hits">32</span>
-
<code class="ruby"> @object = Error[raw.status].new(self)</code>
</li>
<li class="never" data-hits="" data-linenumber="78">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="79">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="79">
+
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="15" data-linenumber="80">
- <span class="hits">15</span>
+ <li class="covered" data-hits="1" data-linenumber="80">
+ <span class="hits">1</span>
<code class="ruby"> def invalid_response?</code>
</li>
- <li class="never" data-hits="" data-linenumber="81">
+ <li class="covered" data-hits="35" data-linenumber="81">
+ <span class="hits">35</span>
-
<code class="ruby"> [400, 404].include?(raw.status)</code>
</li>
<li class="never" data-hits="" data-linenumber="82">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="83">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="83">
+
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="195" data-linenumber="84">
- <span class="hits">195</span>
+ <li class="covered" data-hits="1" data-linenumber="84">
+ <span class="hits">1</span>
<code class="ruby"> def no_content_response?</code>
</li>
- <li class="never" data-hits="" data-linenumber="85">
+ <li class="covered" data-hits="36" data-linenumber="85">
+ <span class="hits">36</span>
-
<code class="ruby"> raw.to_s == '' && raw.status == 204</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="86">
- <span class="hits">3</span>
+ <li class="never" data-hits="" data-linenumber="86">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="87">
- <span class="hits">3</span>
+ <li class="never" data-hits="" data-linenumber="87">
+
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="3" data-linenumber="88">
- <span class="hits">3</span>
+ <li class="covered" data-hits="1" data-linenumber="88">
+ <span class="hits">1</span>
<code class="ruby"> def parse_json!</code>
</li>
- <li class="never" data-hits="" data-linenumber="89">
+ <li class="covered" data-hits="195" data-linenumber="89">
+ <span class="hits">195</span>
-
<code class="ruby"> @object = load_json</code>
</li>
<li class="never" data-hits="" data-linenumber="90">
<code class="ruby"> rescue MultiJson::LoadError => error</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="91">
- <span class="hits">1</span>
+ <li class="covered" data-hits="3" data-linenumber="91">
+ <span class="hits">3</span>
<code class="ruby"> @error_message = error.message</code>
</li>
- <li class="covered" data-hits="204" data-linenumber="92">
- <span class="hits">204</span>
+ <li class="covered" data-hits="3" data-linenumber="92">
+ <span class="hits">3</span>
<code class="ruby"> @status = :error</code>
</li>
- <li class="never" data-hits="" data-linenumber="93">
+ <li class="covered" data-hits="3" data-linenumber="93">
+ <span class="hits">3</span>
-
<code class="ruby"> UnparsableJson.new(self)</code>
</li>
<li class="never" data-hits="" data-linenumber="94">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="95">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="95">
+
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="204" data-linenumber="96">
- <span class="hits">204</span>
+ <li class="covered" data-hits="1" data-linenumber="96">
+ <span class="hits">1</span>
<code class="ruby"> def unzip_response(response)</code>
</li>
- <li class="covered" data-hits="204" data-linenumber="97">
- <span class="hits">204</span>
+ <li class="covered" data-hits="275" data-linenumber="97">
+ <span class="hits">275</span>
<code class="ruby"> parsed_response = response.to_s</code>
</li>
- <li class="covered" data-hits="53" data-linenumber="98">
- <span class="hits">53</span>
+ <li class="covered" data-hits="275" data-linenumber="98">
+ <span class="hits">275</span>
<code class="ruby"> if response.headers['Content-Encoding'].eql?('gzip')</code>
</li>
<li class="covered" data-hits="53" data-linenumber="99">
@@ -11243,25 +11255,25 @@
<span class="hits">53</span>
<code class="ruby"> gz = Zlib::GzipReader.new(sio)</code>
</li>
- <li class="never" data-hits="" data-linenumber="101">
+ <li class="covered" data-hits="53" data-linenumber="101">
+ <span class="hits">53</span>
-
<code class="ruby"> gz.read</code>
</li>
- <li class="covered" data-hits="151" data-linenumber="102">
- <span class="hits">151</span>
+ <li class="never" data-hits="" data-linenumber="102">
+
<code class="ruby"> else</code>
</li>
- <li class="never" data-hits="" data-linenumber="103">
+ <li class="covered" data-hits="222" data-linenumber="103">
+ <span class="hits">222</span>
-
<code class="ruby"> parsed_response</code>
</li>
<li class="never" data-hits="" data-linenumber="104">
@@ -19503,12 +19515,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>31</b> relevant lines.
- <span class="green"><b>31</b> lines covered</span> and
+ <b>145</b> relevant lines.
+ <span class="green"><b>145</b> lines covered</span> and
<span class="red"><b>0</b> lines missed.</span>
</div>
</div>
<pre>
@@ -19596,13 +19608,13 @@
<span class="hits">1</span>
<code class="ruby"> message = "HTTP status code: 404\n"\</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="15">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="15">
+
<code class="ruby"> "Message: The resource could not be found.\n"\</code>
</li>
<li class="never" data-hits="" data-linenumber="16">
@@ -19614,31 +19626,31 @@
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="18">
+ <li class="covered" data-hits="1" data-linenumber="18">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(Contentful::Error.new(r).message).not_to be_nil</code>
</li>
- <li class="never" data-hits="" data-linenumber="19">
+ <li class="covered" data-hits="1" data-linenumber="19">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(Contentful::Error.new(r).message).to eq message</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="20">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="20">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="21">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="21">
+
<code class="ruby"></code>
</li>
<li class="covered" data-hits="1" data-linenumber="22">
<span class="hits">1</span>
@@ -19656,103 +19668,103 @@
<span class="hits">1</span>
<code class="ruby"> it '400' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="25">
+ <li class="covered" data-hits="1" data-linenumber="25">
+ <span class="hits">1</span>
-
<code class="ruby"> response = Contentful::Response.new raw_fixture('default_400', 400)</code>
</li>
- <li class="never" data-hits="" data-linenumber="26">
+ <li class="covered" data-hits="1" data-linenumber="26">
+ <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="27">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="28">
+ <li class="covered" data-hits="1" data-linenumber="28">
+ <span class="hits">1</span>
-
<code class="ruby"> message = "HTTP status code: 400\n"\</code>
</li>
<li class="never" data-hits="" data-linenumber="29">
<code class="ruby"> "Message: The request was malformed or missing a required parameter.\n"\</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="30">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="30">
+
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="31">
+ <li class="covered" data-hits="1" data-linenumber="31">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="32">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="32">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="33">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="33">
+
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="34">
+ <li class="covered" data-hits="1" data-linenumber="34">
+ <span class="hits">1</span>
-
<code class="ruby"> it '401' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="35">
+ <li class="covered" data-hits="1" data-linenumber="35">
+ <span class="hits">1</span>
-
<code class="ruby"> response = Contentful::Response.new raw_fixture('default_401', 401)</code>
</li>
<li class="covered" data-hits="1" data-linenumber="36">
<span class="hits">1</span>
<code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="37">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="37">
+
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="38">
+ <li class="covered" data-hits="1" data-linenumber="38">
+ <span class="hits">1</span>
-
<code class="ruby"> message = "HTTP status code: 401\n"\</code>
</li>
<li class="never" data-hits="" data-linenumber="39">
<code class="ruby"> "Message: The authorization token was invalid.\n"\</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="40">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="40">
+
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
<li class="covered" data-hits="1" data-linenumber="41">
<span class="hits">1</span>
@@ -19782,13 +19794,13 @@
<span class="hits">1</span>
<code class="ruby"> response = Contentful::Response.new raw_fixture('default_403', 403)</code>
</li>
- <li class="never" data-hits="" data-linenumber="46">
+ <li class="covered" data-hits="1" data-linenumber="46">
+ <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="47">
@@ -19800,61 +19812,61 @@
<span class="hits">1</span>
<code class="ruby"> message = "HTTP status code: 403\n"\</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="49">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="49">
+
<code class="ruby"> "Message: The specified token does not have access to the requested resource.\n"\</code>
</li>
<li class="never" data-hits="" data-linenumber="50">
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="51">
+ <li class="covered" data-hits="1" data-linenumber="51">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="52">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="52">
+
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="53">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="53">
+
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="54">
+ <li class="covered" data-hits="1" data-linenumber="54">
+ <span class="hits">1</span>
-
<code class="ruby"> it '404' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="55">
+ <li class="covered" data-hits="1" data-linenumber="55">
+ <span class="hits">1</span>
-
<code class="ruby"> response = Contentful::Response.new raw_fixture('default_404', 404)</code>
</li>
<li class="covered" data-hits="1" data-linenumber="56">
<span class="hits">1</span>
<code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="57">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="57">
+
<code class="ruby"></code>
</li>
<li class="covered" data-hits="1" data-linenumber="58">
<span class="hits">1</span>
@@ -19872,13 +19884,13 @@
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="61">
+ <li class="covered" data-hits="1" data-linenumber="61">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
<li class="never" data-hits="" data-linenumber="62">
@@ -19890,37 +19902,37 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="64">
+ <li class="covered" data-hits="1" data-linenumber="64">
+ <span class="hits">1</span>
-
<code class="ruby"> it '429' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="65">
+ <li class="covered" data-hits="1" data-linenumber="65">
+ <span class="hits">1</span>
-
<code class="ruby"> response = Contentful::Response.new raw_fixture('default_429', 429)</code>
</li>
- <li class="never" data-hits="" data-linenumber="66">
+ <li class="covered" data-hits="1" data-linenumber="66">
+ <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="67">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="68">
+ <li class="covered" data-hits="1" data-linenumber="68">
+ <span class="hits">1</span>
-
<code class="ruby"> message = "HTTP status code: 429\n"\</code>
</li>
<li class="never" data-hits="" data-linenumber="69">
@@ -19932,13 +19944,13 @@
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="71">
+ <li class="covered" data-hits="1" data-linenumber="71">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
<li class="never" data-hits="" data-linenumber="72">
@@ -19950,37 +19962,37 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="74">
+ <li class="covered" data-hits="1" data-linenumber="74">
+ <span class="hits">1</span>
-
<code class="ruby"> it '500' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="75">
+ <li class="covered" data-hits="1" data-linenumber="75">
+ <span class="hits">1</span>
-
<code class="ruby"> response = Contentful::Response.new raw_fixture('default_500', 500)</code>
</li>
- <li class="never" data-hits="" data-linenumber="76">
+ <li class="covered" data-hits="1" data-linenumber="76">
+ <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="77">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="78">
+ <li class="covered" data-hits="1" data-linenumber="78">
+ <span class="hits">1</span>
-
<code class="ruby"> message = "HTTP status code: 500\n"\</code>
</li>
<li class="never" data-hits="" data-linenumber="79">
@@ -19992,13 +20004,13 @@
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="81">
+ <li class="covered" data-hits="1" data-linenumber="81">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
<li class="never" data-hits="" data-linenumber="82">
@@ -20010,37 +20022,37 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="84">
+ <li class="covered" data-hits="1" data-linenumber="84">
+ <span class="hits">1</span>
-
<code class="ruby"> it '502' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="85">
+ <li class="covered" data-hits="1" data-linenumber="85">
+ <span class="hits">1</span>
-
<code class="ruby"> response = Contentful::Response.new raw_fixture('default_502', 502)</code>
</li>
- <li class="never" data-hits="" data-linenumber="86">
+ <li class="covered" data-hits="1" data-linenumber="86">
+ <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="87">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="88">
+ <li class="covered" data-hits="1" data-linenumber="88">
+ <span class="hits">1</span>
-
<code class="ruby"> message = "HTTP status code: 502\n"\</code>
</li>
<li class="never" data-hits="" data-linenumber="89">
@@ -20052,13 +20064,13 @@
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="91">
+ <li class="covered" data-hits="1" data-linenumber="91">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
<li class="never" data-hits="" data-linenumber="92">
@@ -20070,37 +20082,37 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="94">
+ <li class="covered" data-hits="1" data-linenumber="94">
+ <span class="hits">1</span>
-
<code class="ruby"> it '503' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="95">
+ <li class="covered" data-hits="1" data-linenumber="95">
+ <span class="hits">1</span>
-
<code class="ruby"> response = Contentful::Response.new raw_fixture('default_503', 503)</code>
</li>
- <li class="never" data-hits="" data-linenumber="96">
+ <li class="covered" data-hits="1" data-linenumber="96">
+ <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="97">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="98">
+ <li class="covered" data-hits="1" data-linenumber="98">
+ <span class="hits">1</span>
-
<code class="ruby"> message = "HTTP status code: 503\n"\</code>
</li>
<li class="never" data-hits="" data-linenumber="99">
@@ -20112,13 +20124,13 @@
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="101">
+ <li class="covered" data-hits="1" data-linenumber="101">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
<li class="never" data-hits="" data-linenumber="102">
@@ -20136,49 +20148,49 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="105">
+ <li class="covered" data-hits="1" data-linenumber="105">
+ <span class="hits">1</span>
-
<code class="ruby"> describe 'special cases' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="106">
+ <li class="covered" data-hits="1" data-linenumber="106">
+ <span class="hits">1</span>
-
<code class="ruby"> describe '400' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="107">
+ <li class="covered" data-hits="1" data-linenumber="107">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'details is a string' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="108">
+ <li class="covered" data-hits="1" data-linenumber="108">
+ <span class="hits">1</span>
-
<code class="ruby"> response = Contentful::Response.new raw_fixture('400_details_string', 400)</code>
</li>
- <li class="never" data-hits="" data-linenumber="109">
+ <li class="covered" data-hits="1" data-linenumber="109">
+ <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="110">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="111">
+ <li class="covered" data-hits="1" data-linenumber="111">
+ <span class="hits">1</span>
-
<code class="ruby"> message = "HTTP status code: 400\n"\</code>
</li>
<li class="never" data-hits="" data-linenumber="112">
@@ -20196,13 +20208,13 @@
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="115">
+ <li class="covered" data-hits="1" data-linenumber="115">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
<li class="never" data-hits="" data-linenumber="116">
@@ -20214,37 +20226,37 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="118">
+ <li class="covered" data-hits="1" data-linenumber="118">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'details is an object, internal errors are strings' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="119">
+ <li class="covered" data-hits="1" data-linenumber="119">
+ <span class="hits">1</span>
-
<code class="ruby"> response = Contentful::Response.new raw_fixture('400_details_errors_string', 400)</code>
</li>
- <li class="never" data-hits="" data-linenumber="120">
+ <li class="covered" data-hits="1" data-linenumber="120">
+ <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="121">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="122">
+ <li class="covered" data-hits="1" data-linenumber="122">
+ <span class="hits">1</span>
-
<code class="ruby"> message = "HTTP status code: 400\n"\</code>
</li>
<li class="never" data-hits="" data-linenumber="123">
@@ -20262,13 +20274,13 @@
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="126">
+ <li class="covered" data-hits="1" data-linenumber="126">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
<li class="never" data-hits="" data-linenumber="127">
@@ -20280,37 +20292,37 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="129">
+ <li class="covered" data-hits="1" data-linenumber="129">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'details is an object, internal errors are objects which have details' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="130">
+ <li class="covered" data-hits="1" data-linenumber="130">
+ <span class="hits">1</span>
-
<code class="ruby"> response = Contentful::Response.new raw_fixture('400_details_errors_object', 400)</code>
</li>
- <li class="never" data-hits="" data-linenumber="131">
+ <li class="covered" data-hits="1" data-linenumber="131">
+ <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="132">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="133">
+ <li class="covered" data-hits="1" data-linenumber="133">
+ <span class="hits">1</span>
-
<code class="ruby"> message = "HTTP status code: 400\n"\</code>
</li>
<li class="never" data-hits="" data-linenumber="134">
@@ -20328,13 +20340,13 @@
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="137">
+ <li class="covered" data-hits="1" data-linenumber="137">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
<li class="never" data-hits="" data-linenumber="138">
@@ -20352,43 +20364,43 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="141">
+ <li class="covered" data-hits="1" data-linenumber="141">
+ <span class="hits">1</span>
-
<code class="ruby"> describe '403' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="142">
+ <li class="covered" data-hits="1" data-linenumber="142">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'has an array of reasons' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="143">
+ <li class="covered" data-hits="1" data-linenumber="143">
+ <span class="hits">1</span>
-
<code class="ruby"> response = Contentful::Response.new raw_fixture('403_reasons', 403)</code>
</li>
- <li class="never" data-hits="" data-linenumber="144">
+ <li class="covered" data-hits="1" data-linenumber="144">
+ <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="145">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="146">
+ <li class="covered" data-hits="1" data-linenumber="146">
+ <span class="hits">1</span>
-
<code class="ruby"> message = "HTTP status code: 403\n"\</code>
</li>
<li class="never" data-hits="" data-linenumber="147">
@@ -20418,13 +20430,13 @@
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="152">
+ <li class="covered" data-hits="1" data-linenumber="152">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
<li class="never" data-hits="" data-linenumber="153">
@@ -20442,43 +20454,43 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="156">
+ <li class="covered" data-hits="1" data-linenumber="156">
+ <span class="hits">1</span>
-
<code class="ruby"> describe '404' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="157">
+ <li class="covered" data-hits="1" data-linenumber="157">
+ <span class="hits">1</span>
-
- <code class="ruby"> it 'has a type' do</code>
+ <code class="ruby"> it 'details is a string' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="158">
+ <li class="covered" data-hits="1" data-linenumber="158">
+ <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('404_type', 404)</code>
+ <code class="ruby"> response = Contentful::Response.new raw_fixture('404_details_string', 404)</code>
</li>
- <li class="never" data-hits="" data-linenumber="159">
+ <li class="covered" data-hits="1" data-linenumber="159">
+ <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="160">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="161">
+ <li class="covered" data-hits="1" data-linenumber="161">
+ <span class="hits">1</span>
-
<code class="ruby"> message = "HTTP status code: 404\n"\</code>
</li>
<li class="never" data-hits="" data-linenumber="162">
@@ -20487,22 +20499,22 @@
</li>
<li class="never" data-hits="" data-linenumber="163">
- <code class="ruby"> "Details: The requested Asset could not be found.\n"\</code>
+ <code class="ruby"> "Details: The resource could not be found\n"\</code>
</li>
<li class="never" data-hits="" data-linenumber="164">
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="165">
+ <li class="covered" data-hits="1" data-linenumber="165">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
<li class="never" data-hits="" data-linenumber="166">
@@ -20514,37 +20526,37 @@
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="168">
+ <li class="covered" data-hits="1" data-linenumber="168">
+ <span class="hits">1</span>
-
- <code class="ruby"> it 'can specify the resource id' do</code>
+ <code class="ruby"> it 'has a type' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="169">
+ <li class="covered" data-hits="1" data-linenumber="169">
+ <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('404_id', 404)</code>
+ <code class="ruby"> response = Contentful::Response.new raw_fixture('404_type', 404)</code>
</li>
- <li class="never" data-hits="" data-linenumber="170">
+ <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>
</li>
<li class="never" data-hits="" data-linenumber="171">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="172">
+ <li class="covered" data-hits="1" data-linenumber="172">
+ <span class="hits">1</span>
-
<code class="ruby"> message = "HTTP status code: 404\n"\</code>
</li>
<li class="never" data-hits="" data-linenumber="173">
@@ -20553,22 +20565,22 @@
</li>
<li class="never" data-hits="" data-linenumber="174">
- <code class="ruby"> "Details: The requested Asset could not be found. ID: foobar.\n"\</code>
+ <code class="ruby"> "Details: The requested Asset could not be found.\n"\</code>
</li>
<li class="never" data-hits="" data-linenumber="175">
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="176">
+ <li class="covered" data-hits="1" data-linenumber="176">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
<li class="never" data-hits="" data-linenumber="177">
@@ -20577,758 +20589,824 @@
</li>
<li class="never" data-hits="" data-linenumber="178">
- <code class="ruby"> end</code>
+ <code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="179">
+ <li class="covered" data-hits="1" data-linenumber="179">
+ <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">
+ <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">
+ <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">
+
+
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="180">
+ <li class="covered" data-hits="1" data-linenumber="183">
+ <span class="hits">1</span>
+ <code class="ruby"> message = "HTTP status code: 404\n"\</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="184">
- <code class="ruby"> describe '429' do</code>
+
+ <code class="ruby"> "Message: The requested resource or endpoint could not be found.\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="181">
+ <li class="never" data-hits="" data-linenumber="185">
- <code class="ruby"> it 'can show the time until reset' do</code>
+ <code class="ruby"> "Details: The requested Asset could not be found. ID: foobar.\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="182">
+ <li class="never" data-hits="" data-linenumber="186">
- <code class="ruby"> response = Contentful::Response.new raw_fixture('default_429', 429, false, {'x-contentful-ratelimit-reset' => 60})</code>
+ <code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="183">
+ <li class="covered" data-hits="1" data-linenumber="187">
+ <span class="hits">1</span>
+ <code class="ruby"> expect(error.message).to eq message</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="188">
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
+
+ <code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="184">
+ <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"></code>
</li>
- <li class="never" data-hits="" data-linenumber="185">
+ <li class="covered" data-hits="1" data-linenumber="191">
+ <span class="hits">1</span>
+ <code class="ruby"> describe '429' do</code>
+ </li>
+
+ <li class="covered" data-hits="1" data-linenumber="192">
+ <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">
+ <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">
+ <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">
+
+
+ <code class="ruby"></code>
+ </li>
+
+ <li class="covered" data-hits="1" data-linenumber="196">
+ <span class="hits">1</span>
+
<code class="ruby"> message = "HTTP status code: 429\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="186">
+ <li class="never" data-hits="" data-linenumber="197">
<code class="ruby"> "Message: Rate limit exceeded. Too many requests.\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="187">
+ <li class="never" data-hits="" data-linenumber="198">
<code class="ruby"> "Request ID: 85f-351076632\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="188">
+ <li class="never" data-hits="" data-linenumber="199">
<code class="ruby"> "Time until reset (seconds): 60"</code>
</li>
- <li class="never" data-hits="" data-linenumber="189">
+ <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="190">
+ <li class="never" data-hits="" data-linenumber="201">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="191">
+ <li class="never" data-hits="" data-linenumber="202">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="192">
+ <li class="never" data-hits="" data-linenumber="203">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="193">
+ <li class="never" data-hits="" data-linenumber="204">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="194">
+ <li class="covered" data-hits="1" data-linenumber="205">
+ <span class="hits">1</span>
-
<code class="ruby"> describe 'generic error' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="195">
+ <li class="covered" data-hits="1" data-linenumber="206">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'with everything' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="196">
+ <li class="covered" data-hits="1" data-linenumber="207">
+ <span class="hits">1</span>
-
<code class="ruby"> response = Contentful::Response.new raw_fixture('other_error', 512)</code>
</li>
- <li class="never" data-hits="" data-linenumber="197">
+ <li class="covered" data-hits="1" data-linenumber="208">
+ <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="198">
+ <li class="never" data-hits="" data-linenumber="209">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="199">
+ <li class="covered" data-hits="1" data-linenumber="210">
+ <span class="hits">1</span>
-
<code class="ruby"> message = "HTTP status code: 512\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="200">
+ <li class="never" data-hits="" data-linenumber="211">
<code class="ruby"> "Message: Some error occurred.\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="201">
+ <li class="never" data-hits="" data-linenumber="212">
<code class="ruby"> "Details: some text\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="202">
+ <li class="never" data-hits="" data-linenumber="213">
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="203">
+ <li class="covered" data-hits="1" data-linenumber="214">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
- <li class="never" data-hits="" data-linenumber="204">
+ <li class="never" data-hits="" data-linenumber="215">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="205">
+ <li class="never" data-hits="" data-linenumber="216">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="206">
+ <li class="covered" data-hits="1" data-linenumber="217">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'no details' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="207">
+ <li class="covered" data-hits="1" data-linenumber="218">
+ <span class="hits">1</span>
-
<code class="ruby"> response = Contentful::Response.new raw_fixture('other_error_no_details', 512)</code>
</li>
- <li class="never" data-hits="" data-linenumber="208">
+ <li class="covered" data-hits="1" data-linenumber="219">
+ <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="220">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="210">
+ <li class="covered" data-hits="1" data-linenumber="221">
+ <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="222">
<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="223">
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="213">
+ <li class="covered" data-hits="1" data-linenumber="224">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
- <li class="never" data-hits="" data-linenumber="214">
+ <li class="never" data-hits="" data-linenumber="225">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="215">
+ <li class="never" data-hits="" data-linenumber="226">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="216">
+ <li class="covered" data-hits="1" data-linenumber="227">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'no request id' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="217">
+ <li class="covered" data-hits="1" data-linenumber="228">
+ <span class="hits">1</span>
-
<code class="ruby"> response = Contentful::Response.new raw_fixture('other_error_no_request_id', 512)</code>
</li>
- <li class="never" data-hits="" data-linenumber="218">
+ <li class="covered" data-hits="1" data-linenumber="229">
+ <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="219">
+ <li class="never" data-hits="" data-linenumber="230">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="220">
+ <li class="covered" data-hits="1" data-linenumber="231">
+ <span class="hits">1</span>
-
<code class="ruby"> message = "HTTP status code: 512\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="221">
+ <li class="never" data-hits="" data-linenumber="232">
<code class="ruby"> "Message: Some error occurred.\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="222">
+ <li class="never" data-hits="" data-linenumber="233">
<code class="ruby"> "Details: some text"</code>
</li>
- <li class="never" data-hits="" data-linenumber="223">
+ <li class="covered" data-hits="1" data-linenumber="234">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
- <li class="never" data-hits="" data-linenumber="224">
+ <li class="never" data-hits="" data-linenumber="235">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="225">
+ <li class="never" data-hits="" data-linenumber="236">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="226">
+ <li class="covered" data-hits="1" data-linenumber="237">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'no message' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="227">
+ <li class="covered" data-hits="1" data-linenumber="238">
+ <span class="hits">1</span>
-
<code class="ruby"> response = Contentful::Response.new raw_fixture('other_error_no_message', 512)</code>
</li>
- <li class="never" data-hits="" data-linenumber="228">
+ <li class="covered" data-hits="1" data-linenumber="239">
+ <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="229">
+ <li class="never" data-hits="" data-linenumber="240">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="230">
+ <li class="covered" data-hits="1" data-linenumber="241">
+ <span class="hits">1</span>
-
<code class="ruby"> message = "HTTP status code: 512\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="231">
+ <li class="never" data-hits="" data-linenumber="242">
<code class="ruby"> "Message: The following error was received: {\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="232">
+ <li class="never" data-hits="" data-linenumber="243">
<code class="ruby"> " \"sys\": {\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="233">
+ <li class="never" data-hits="" data-linenumber="244">
<code class="ruby"> " \"type\": \"Error\",\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="234">
+ <li class="never" data-hits="" data-linenumber="245">
<code class="ruby"> " \"id\": \"SomeError\"\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="235">
+ <li class="never" data-hits="" data-linenumber="246">
<code class="ruby"> " },\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="236">
+ <li class="never" data-hits="" data-linenumber="247">
<code class="ruby"> " \"details\": \"some text\",\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="237">
+ <li class="never" data-hits="" data-linenumber="248">
<code class="ruby"> " \"requestId\": \"85f-351076632\"\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="238">
+ <li class="never" data-hits="" data-linenumber="249">
<code class="ruby"> "}\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="239">
+ <li class="never" data-hits="" data-linenumber="250">
<code class="ruby"> "\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="240">
+ <li class="never" data-hits="" data-linenumber="251">
<code class="ruby"> "Details: some text\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="241">
+ <li class="never" data-hits="" data-linenumber="252">
<code class="ruby"> "Request ID: 85f-351076632"</code>
</li>
- <li class="never" data-hits="" data-linenumber="242">
+ <li class="covered" data-hits="1" data-linenumber="253">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
- <li class="never" data-hits="" data-linenumber="243">
+ <li class="never" data-hits="" data-linenumber="254">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="244">
+ <li class="never" data-hits="" data-linenumber="255">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="245">
+ <li class="covered" data-hits="1" data-linenumber="256">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'nothing' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="246">
+ <li class="covered" data-hits="1" data-linenumber="257">
+ <span class="hits">1</span>
-
<code class="ruby"> response = Contentful::Response.new raw_fixture('other_error_nothing', 512)</code>
</li>
- <li class="never" data-hits="" data-linenumber="247">
+ <li class="covered" data-hits="1" data-linenumber="258">
+ <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="248">
+ <li class="never" data-hits="" data-linenumber="259">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="249">
+ <li class="covered" data-hits="1" data-linenumber="260">
+ <span class="hits">1</span>
-
<code class="ruby"> message = "HTTP status code: 512\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="250">
+ <li class="never" data-hits="" data-linenumber="261">
<code class="ruby"> "Message: The following error was received: {\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="251">
+ <li class="never" data-hits="" data-linenumber="262">
<code class="ruby"> " \"sys\": {\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="252">
+ <li class="never" data-hits="" data-linenumber="263">
<code class="ruby"> " \"type\": \"Error\",\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="253">
+ <li class="never" data-hits="" data-linenumber="264">
<code class="ruby"> " \"id\": \"SomeError\"\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="254">
+ <li class="never" data-hits="" data-linenumber="265">
<code class="ruby"> " }\n"\</code>
</li>
- <li class="never" data-hits="" data-linenumber="255">
+ <li class="never" data-hits="" data-linenumber="266">
<code class="ruby"> "}\n"</code>
</li>
- <li class="never" data-hits="" data-linenumber="256">
+ <li class="covered" data-hits="1" data-linenumber="267">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(error.message).to eq message</code>
</li>
- <li class="never" data-hits="" data-linenumber="257">
+ <li class="never" data-hits="" data-linenumber="268">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="258">
+ <li class="never" data-hits="" data-linenumber="269">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="259">
+ <li class="never" data-hits="" data-linenumber="270">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="260">
+ <li class="never" data-hits="" data-linenumber="271">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="261">
+ <li class="never" data-hits="" data-linenumber="272">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="262">
+ <li class="covered" data-hits="1" data-linenumber="273">
+ <span class="hits">1</span>
-
<code class="ruby"> describe Contentful::UnparsableJson do</code>
</li>
- <li class="never" data-hits="" data-linenumber="263">
+ <li class="covered" data-hits="1" data-linenumber="274">
+ <span class="hits">1</span>
-
<code class="ruby"> describe '#message' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="264">
+ <li class="covered" data-hits="1" data-linenumber="275">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'returns the json parser\'s message' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="265">
+ <li class="covered" data-hits="1" data-linenumber="276">
+ <span class="hits">1</span>
-
<code class="ruby"> uj = Contentful::Response.new raw_fixture('unparsable')</code>
</li>
- <li class="never" data-hits="" data-linenumber="266">
+ <li class="covered" data-hits="1" data-linenumber="277">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(Contentful::UnparsableJson.new(uj).message).to \</code>
</li>
- <li class="never" data-hits="" data-linenumber="267">
+ <li class="never" data-hits="" data-linenumber="278">
<code class="ruby"> include 'unexpected token'</code>
</li>
- <li class="never" data-hits="" data-linenumber="268">
+ <li class="never" data-hits="" data-linenumber="279">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="269">
+ <li class="never" data-hits="" data-linenumber="280">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="270">
+ <li class="never" data-hits="" data-linenumber="281">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="271">
+ <li class="never" data-hits="" data-linenumber="282">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="272">
+ <li class="covered" data-hits="1" data-linenumber="283">
+ <span class="hits">1</span>
-
<code class="ruby"> describe '.[]' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="273">
+ <li class="covered" data-hits="1" data-linenumber="284">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'returns BadRequest error class for 400' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="274">
+ <li class="covered" data-hits="1" data-linenumber="285">
+ <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="275">
+ <li class="never" data-hits="" data-linenumber="286">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="276">
+ <li class="never" data-hits="" data-linenumber="287">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="277">
+ <li class="covered" data-hits="1" data-linenumber="288">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'returns Unauthorized error class for 401' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="278">
+ <li class="covered" data-hits="1" data-linenumber="289">
+ <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="279">
+ <li class="never" data-hits="" data-linenumber="290">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="280">
+ <li class="never" data-hits="" data-linenumber="291">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="281">
+ <li class="covered" data-hits="1" data-linenumber="292">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'returns AccessDenied error class for 403' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="282">
+ <li class="covered" data-hits="1" data-linenumber="293">
+ <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="283">
+ <li class="never" data-hits="" data-linenumber="294">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="284">
+ <li class="never" data-hits="" data-linenumber="295">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="285">
+ <li class="covered" data-hits="1" data-linenumber="296">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'returns NotFound error class for 404' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="286">
+ <li class="covered" data-hits="1" data-linenumber="297">
+ <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="287">
+ <li class="never" data-hits="" data-linenumber="298">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="288">
+ <li class="never" data-hits="" data-linenumber="299">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="289">
+ <li class="covered" data-hits="1" data-linenumber="300">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'returns ServerError error class for 500' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="290">
+ <li class="covered" data-hits="1" data-linenumber="301">
+ <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="291">
+ <li class="never" data-hits="" data-linenumber="302">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="292">
+ <li class="never" data-hits="" data-linenumber="303">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="293">
+ <li class="covered" data-hits="1" data-linenumber="304">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'returns ServiceUnavailable error class for 503' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="294">
+ <li class="covered" data-hits="1" data-linenumber="305">
+ <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="295">
+ <li class="never" data-hits="" data-linenumber="306">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="296">
+ <li class="never" data-hits="" data-linenumber="307">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="297">
+ <li class="covered" data-hits="1" data-linenumber="308">
+ <span class="hits">1</span>
-
<code class="ruby"> it 'returns generic error class for any other value' do</code>
</li>
- <li class="never" data-hits="" data-linenumber="298">
+ <li class="covered" data-hits="1" data-linenumber="309">
+ <span class="hits">1</span>
-
<code class="ruby"> expect(Contentful::Error[nil]).to eq Contentful::Error</code>
</li>
- <li class="never" data-hits="" data-linenumber="299">
+ <li class="covered" data-hits="1" data-linenumber="310">
+ <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="300">
+ <li class="never" data-hits="" data-linenumber="311">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="301">
+ <li class="never" data-hits="" data-linenumber="312">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="302">
+ <li class="never" data-hits="" data-linenumber="313">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="303">
+ <li class="never" data-hits="" data-linenumber="314">
<code class="ruby">end</code>
</li>
@@ -24447,12 +24525,12 @@
<div class="source_table" id="a4ba320676b73b8644cffc9dbb12bbe8e19a9934">
<div class="header">
<h3>spec/support/json_responses.rb</h3>
<h4><span class="green">100.0 %</span> covered</h4>
<div>
- <b>9</b> relevant lines.
- <span class="green"><b>9</b> lines covered</span> and
+ <b>11</b> relevant lines.
+ <span class="green"><b>11</b> lines covered</span> and
<span class="red"><b>0</b> lines missed.</span>
</div>
</div>
<pre>
@@ -24474,77 +24552,77 @@
<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="18" data-linenumber="4">
- <span class="hits">18</span>
+ <li class="covered" data-hits="39" data-linenumber="4">
+ <span class="hits">39</span>
<code class="ruby"> object = Object.new</code>
</li>
- <li class="covered" data-hits="46" data-linenumber="5">
- <span class="hits">46</span>
+ <li class="covered" data-hits="218" data-linenumber="5">
+ <span class="hits">218</span>
<code class="ruby"> allow(object).to receive(:status) { status }</code>
</li>
- <li class="covered" data-hits="34" data-linenumber="6">
- <span class="hits">34</span>
+ <li class="covered" data-hits="121" data-linenumber="6">
+ <span class="hits">121</span>
<code class="ruby"> allow(object).to receive(:headers) { headers }</code>
</li>
- <li class="covered" data-hits="41" data-linenumber="7">
- <span class="hits">41</span>
+ <li class="covered" data-hits="158" data-linenumber="7">
+ <span class="hits">158</span>
<code class="ruby"> allow(object).to receive(:to_s) { File.read File.dirname(__FILE__) + "/../fixtures/json_responses/#{which}.json" }</code>
</li>
- <li class="never" data-hits="" data-linenumber="8">
+ <li class="covered" data-hits="52" data-linenumber="8">
+ <span class="hits">52</span>
-
<code class="ruby"> allow(object).to receive(:body) { object.to_s }</code>
</li>
- <li class="covered" data-hits="18" data-linenumber="9">
- <span class="hits">18</span>
+ <li class="covered" data-hits="43" data-linenumber="9">
+ <span class="hits">43</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="never" data-hits="" data-linenumber="11">
+ <li class="covered" data-hits="39" data-linenumber="11">
+ <span class="hits">39</span>
-
<code class="ruby"> object</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="12">
- <span class="hits">1</span>
+ <li class="never" data-hits="" data-linenumber="12">
+
<code class="ruby">end</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="13">
- <span class="hits">2</span>
+ <li class="never" data-hits="" data-linenumber="13">
+
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="14">
+ <li class="covered" data-hits="1" data-linenumber="14">
+ <span class="hits">1</span>
-
<code class="ruby">def json_fixture(which, _as_json = false)</code>
</li>
- <li class="never" data-hits="" data-linenumber="15">
-
+ <li class="covered" data-hits="1" data-linenumber="15">
+ <span class="hits">1</span>
<code class="ruby"> MultiJson.load(</code>
</li>
<li class="never" data-hits="" data-linenumber="16">