./coverage/index.html in sinatra-param-1.0.2 vs ./coverage/index.html in sinatra-param-1.0.3
- old
+ new
@@ -1,42 +1,42 @@
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>Code coverage for Sinatra-param</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <script src='./assets/0.7.1/application.js' type='text/javascript'></script>
+ <script src='./assets/0.7.1/application.js' type='text/javascript'></script>
<link href='./assets/0.7.1/application.css' media='screen, projection, print' rel='stylesheet' type='text/css'>
- <link rel="shortcut icon" type="image/png" href="./assets/0.7.1/favicon_red.png" />
+ <link rel="shortcut icon" type="image/png" href="./assets/0.7.1/favicon_green.png" />
<link rel="icon" type="image/png" href="./assets/0.7.1/favicon.png" />
</head>
-
+
<body>
<div id="loading">
<img src="./assets/0.7.1/loading.gif" alt="loading"/>
</div>
<div id="wrapper" style="display:none;">
- <div class="timestamp">Generated <abbr class="timeago" title="2013-01-20T22:57:14-08:00">2013-01-20T22:57:14-08:00</abbr></div>
+ <div class="timestamp">Generated <abbr class="timeago" title="2013-12-02T12:12:13-08:00">2013-12-02T12:12:13-08: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="red">28.57%</span></span>
+ (<span class="covered_percent"><span class="green">100.0%</span></span>
covered at
<span class="covered_strength">
- <span class="red">
- 0.65
+ <span class="green">
+ 18.4
</span>
</span> hits/line)
</h2>
<a name="AllFiles"></a>
<div>
- <b>2</b> files in total.
- <b>63</b> relevant lines.
- <span class="green"><b>18</b> lines covered</span> and
- <span class="red"><b>45</b> lines missed </span>
+ <b>1</b> files in total.
+ <b>64</b> relevant lines.
+ <span class="green"><b>64</b> lines covered</span> and
+ <span class="red"><b>0</b> lines missed </span>
</div>
<table class="file_list">
<thead>
<tr>
<th>File</th>
@@ -47,742 +47,726 @@
<th>Lines missed</th>
<th>Avg. Hits / Line</th>
</tr>
</thead>
<tbody>
-
+
<tr>
<td class="strong"><a href="#0f7926ededdfd8418773c107837b6dc4182659b8" class="src_link" title="lib/sinatra/param.rb">lib/sinatra/param.rb</a></td>
- <td class="red strong">25.0 %</td>
- <td>105</td>
- <td>60</td>
- <td>15</td>
- <td>45</td>
- <td>0.3</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#95bc1568394aeedcc2389ae1301b3fd7e08bf109" class="src_link" title="lib/sinatra/param/version.rb">lib/sinatra/param/version.rb</a></td>
<td class="green strong">100.0 %</td>
- <td>5</td>
- <td>3</td>
- <td>3</td>
+ <td>112</td>
+ <td>64</td>
+ <td>64</td>
<td>0</td>
- <td>1.0</td>
+ <td>18.4</td>
</tr>
-
+
</tbody>
</table>
</div>
-
+
</div>
-
+
<div id="footer">
- Generated by <a href="http://github.com/colszowka/simplecov">simplecov</a> v0.7.1
+ Generated by <a href="http://github.com/colszowka/simplecov">simplecov</a> v0.7.1
and simplecov-html v0.7.1<br/>
using RSpec
</div>
-
+
<div class="source_files">
-
+
<div class="source_table" id="0f7926ededdfd8418773c107837b6dc4182659b8">
<div class="header">
<h3>lib/sinatra/param.rb</h3>
- <h4><span class="red">25.0 %</span> covered</h4>
+ <h4><span class="green">100.0 %</span> covered</h4>
<div>
- <b>60</b> relevant lines.
- <span class="green"><b>15</b> lines covered</span> and
- <span class="red"><b>45</b> lines missed.</span>
+ <b>64</b> relevant lines.
+ <span class="green"><b>64</b> lines covered</span> and
+ <span class="red"><b>0</b> lines missed.</span>
</div>
</div>
-
+
<pre>
<ol>
-
+
<li class="covered" data-hits="1" data-linenumber="1">
<span class="hits">1</span>
-
- <code class="ruby">require 'sinatra/base'</code>
+
+ <code class="ruby">require 'sinatra/base'</code>
</li>
-
+
<li class="covered" data-hits="1" data-linenumber="2">
<span class="hits">1</span>
-
- <code class="ruby">require 'sinatra/param/version'</code>
+
+ <code class="ruby">require 'sinatra/param/version'</code>
</li>
-
+
<li class="covered" data-hits="1" data-linenumber="3">
<span class="hits">1</span>
-
- <code class="ruby">require 'time'</code>
+
+ <code class="ruby">require 'time'</code>
</li>
-
+
<li class="covered" data-hits="1" data-linenumber="4">
<span class="hits">1</span>
-
- <code class="ruby">require 'date'</code>
+
+ <code class="ruby">require 'date'</code>
</li>
-
+
<li class="never" data-hits="" data-linenumber="5">
-
-
+
+
<code class="ruby"></code>
</li>
-
+
<li class="covered" data-hits="1" data-linenumber="6">
<span class="hits">1</span>
-
+
<code class="ruby">module Sinatra</code>
</li>
-
+
<li class="covered" data-hits="1" data-linenumber="7">
<span class="hits">1</span>
-
+
<code class="ruby"> module Param</code>
</li>
-
+
<li class="covered" data-hits="1" data-linenumber="8">
<span class="hits">1</span>
-
- <code class="ruby"> class InvalidParameterError < StandardError; end</code>
+
+ <code class="ruby"> Boolean = :boolean</code>
</li>
-
+
<li class="never" data-hits="" data-linenumber="9">
-
-
+
+
<code class="ruby"></code>
</li>
-
+
<li class="covered" data-hits="1" data-linenumber="10">
<span class="hits">1</span>
-
+
+ <code class="ruby"> class InvalidParameterError < StandardError; end</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="11">
+
+
+ <code class="ruby"></code>
+ </li>
+
+ <li class="covered" data-hits="1" data-linenumber="12">
+ <span class="hits">1</span>
+
<code class="ruby"> def param(name, type, options = {})</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="11">
-
-
+
+ <li class="covered" data-hits="76" data-linenumber="13">
+ <span class="hits">76</span>
+
+ <code class="ruby"> name = name.to_s</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="14">
+
+
+ <code class="ruby"></code>
+ </li>
+
+ <li class="covered" data-hits="76" data-linenumber="15">
+ <span class="hits">76</span>
+
+ <code class="ruby"> return unless params.member?(name) or present?(options[:default]) or options[:required]</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="16">
+
+
+ <code class="ruby"></code>
+ </li>
+
+ <li class="covered" data-hits="67" data-linenumber="17">
+ <span class="hits">67</span>
+
<code class="ruby"> begin</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="12">
-
-
- <code class="ruby"> params[name] = coerce(params[name], type, options) || options[:default]</code>
+
+ <li class="covered" data-hits="67" data-linenumber="18">
+ <span class="hits">67</span>
+
+ <code class="ruby"> params[name] = coerce(params[name], type, options)</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="13">
-
-
+
+ <li class="covered" data-hits="67" data-linenumber="19">
+ <span class="hits">67</span>
+
+ <code class="ruby"> params[name] = options[:default] if params[name].nil? and options[:default]</code>
+ </li>
+
+ <li class="covered" data-hits="67" data-linenumber="20">
+ <span class="hits">67</span>
+
<code class="ruby"> params[name] = options[:transform].to_proc.call(params[name]) if options[:transform]</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="14">
-
-
+
+ <li class="covered" data-hits="67" data-linenumber="21">
+ <span class="hits">67</span>
+
<code class="ruby"> validate!(params[name], options)</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="15">
-
-
+
+ <li class="never" data-hits="" data-linenumber="22">
+
+
<code class="ruby"> rescue</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="16">
-
-
+
+ <li class="covered" data-hits="13" data-linenumber="23">
+ <span class="hits">13</span>
+
<code class="ruby"> error = "Invalid parameter, #{name}"</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="17">
-
-
+
+ <li class="covered" data-hits="13" data-linenumber="24">
+ <span class="hits">13</span>
+
<code class="ruby"> if content_type and content_type.match(mime_type(:json))</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="18">
-
-
+
+ <li class="covered" data-hits="13" data-linenumber="25">
+ <span class="hits">13</span>
+
<code class="ruby"> error = {message: error}.to_json</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="19">
-
-
+
+ <li class="never" data-hits="" data-linenumber="26">
+
+
<code class="ruby"> end</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="20">
-
-
+
+ <li class="never" data-hits="" data-linenumber="27">
+
+
<code class="ruby"></code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="21">
-
-
+
+ <li class="covered" data-hits="13" data-linenumber="28">
+ <span class="hits">13</span>
+
<code class="ruby"> halt 400, error</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="22">
-
-
+
+ <li class="never" data-hits="" data-linenumber="29">
+
+
<code class="ruby"> end</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="23">
-
-
+
+ <li class="never" data-hits="" data-linenumber="30">
+
+
<code class="ruby"> end</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="24">
-
-
+
+ <li class="never" data-hits="" data-linenumber="31">
+
+
<code class="ruby"></code>
</li>
-
- <li class="covered" data-hits="1" data-linenumber="25">
+
+ <li class="covered" data-hits="1" data-linenumber="32">
<span class="hits">1</span>
-
+
<code class="ruby"> def one_of(*names)</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="26">
-
-
+
+ <li class="covered" data-hits="6" data-linenumber="33">
+ <span class="hits">6</span>
+
<code class="ruby"> count = 0</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="27">
-
-
+
+ <li class="covered" data-hits="6" data-linenumber="34">
+ <span class="hits">6</span>
+
<code class="ruby"> names.each do |name|</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="28">
-
-
+
+ <li class="covered" data-hits="16" data-linenumber="35">
+ <span class="hits">16</span>
+
<code class="ruby"> if params[name] and present?(params[name])</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="29">
-
-
+
+ <li class="covered" data-hits="9" data-linenumber="36">
+ <span class="hits">9</span>
+
<code class="ruby"> count += 1</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="30">
-
-
+
+ <li class="covered" data-hits="9" data-linenumber="37">
+ <span class="hits">9</span>
+
<code class="ruby"> next unless count > 1</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="31">
-
-
+
+ <li class="never" data-hits="" data-linenumber="38">
+
+
<code class="ruby"></code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="32">
-
-
- <code class="ruby"> error = "Parameters #{names.join(', ')} are mutually exclusive"</code>
+
+ <li class="covered" data-hits="3" data-linenumber="39">
+ <span class="hits">3</span>
+
+ <code class="ruby"> error = "Parameters #{names.join(', ')} are mutually exclusive"</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="33">
-
-
+
+ <li class="covered" data-hits="3" data-linenumber="40">
+ <span class="hits">3</span>
+
<code class="ruby"> if content_type and content_type.match(mime_type(:json))</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="34">
-
-
+
+ <li class="covered" data-hits="3" data-linenumber="41">
+ <span class="hits">3</span>
+
<code class="ruby"> error = {message: error}.to_json</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="35">
-
-
+
+ <li class="never" data-hits="" data-linenumber="42">
+
+
<code class="ruby"> end</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="36">
-
-
+
+ <li class="never" data-hits="" data-linenumber="43">
+
+
<code class="ruby"></code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="37">
-
-
+
+ <li class="covered" data-hits="3" data-linenumber="44">
+ <span class="hits">3</span>
+
<code class="ruby"> halt 400, error</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="38">
-
-
+
+ <li class="never" data-hits="" data-linenumber="45">
+
+
<code class="ruby"> end</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="39">
-
-
+
+ <li class="never" data-hits="" data-linenumber="46">
+
+
<code class="ruby"> end</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="40">
-
-
+
+ <li class="never" data-hits="" data-linenumber="47">
+
+
<code class="ruby"> end</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="41">
-
-
+
+ <li class="never" data-hits="" data-linenumber="48">
+
+
<code class="ruby"></code>
</li>
-
- <li class="covered" data-hits="1" data-linenumber="42">
+
+ <li class="covered" data-hits="1" data-linenumber="49">
<span class="hits">1</span>
-
+
<code class="ruby"> private</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="43">
-
-
+
+ <li class="never" data-hits="" data-linenumber="50">
+
+
<code class="ruby"></code>
</li>
-
- <li class="covered" data-hits="1" data-linenumber="44">
+
+ <li class="covered" data-hits="1" data-linenumber="51">
<span class="hits">1</span>
-
+
<code class="ruby"> def coerce(param, type, options = {})</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="45">
-
-
+
+ <li class="covered" data-hits="67" data-linenumber="52">
+ <span class="hits">67</span>
+
<code class="ruby"> return nil if param.nil?</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="46">
-
-
+
+ <li class="covered" data-hits="64" data-linenumber="53">
+ <span class="hits">64</span>
+
<code class="ruby"> return param if (param.is_a?(type) rescue false)</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="47">
-
-
+
+ <li class="covered" data-hits="39" data-linenumber="54">
+ <span class="hits">39</span>
+
<code class="ruby"> return Integer(param) if type == Integer</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="48">
-
-
+
+ <li class="covered" data-hits="30" data-linenumber="55">
+ <span class="hits">30</span>
+
<code class="ruby"> return Float(param) if type == Float</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="49">
-
-
+
+ <li class="covered" data-hits="29" data-linenumber="56">
+ <span class="hits">29</span>
+
<code class="ruby"> return String(param) if type == String</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="50">
-
-
+
+ <li class="covered" data-hits="28" data-linenumber="57">
+ <span class="hits">28</span>
+
<code class="ruby"> return Time.parse(param) if type == Time</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="51">
-
-
+
+ <li class="covered" data-hits="27" data-linenumber="58">
+ <span class="hits">27</span>
+
<code class="ruby"> return Date.parse(param) if type == Date</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="52">
-
-
+
+ <li class="covered" data-hits="26" data-linenumber="59">
+ <span class="hits">26</span>
+
<code class="ruby"> return DateTime.parse(param) if type == DateTime</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="53">
-
-
+
+ <li class="covered" data-hits="25" data-linenumber="60">
+ <span class="hits">25</span>
+
<code class="ruby"> return Array(param.split(options[:delimiter] || ",")) if type == Array</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="54">
-
-
+
+ <li class="covered" data-hits="25" data-linenumber="61">
+ <span class="hits">25</span>
+
<code class="ruby"> return Hash[param.split(options[:delimiter] || ",").map{|c| c.split(options[:separator] || ":")}] if type == Hash</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="55">
-
-
- <code class="ruby"> return (/(false|f|no|n|0)$/i === param.to_s ? false : (/(true|t|yes|y|1)$/i === param.to_s ? true : nil)) if type == TrueClass || type == FalseClass || type == :boolean</code>
+
+ <li class="covered" data-hits="21" data-linenumber="62">
+ <span class="hits">21</span>
+
+ <code class="ruby"> return (/(false|f|no|n|0)$/i === param.to_s ? false : (/(true|t|yes|y|1)$/i === param.to_s ? true : nil)) if type == TrueClass || type == FalseClass || type == Boolean</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="56">
-
-
+
+ <li class="never" data-hits="" data-linenumber="63">
+
+
<code class="ruby"> return nil</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="57">
-
-
+
+ <li class="never" data-hits="" data-linenumber="64">
+
+
<code class="ruby"> end</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="58">
-
-
+
+ <li class="never" data-hits="" data-linenumber="65">
+
+
<code class="ruby"></code>
</li>
-
- <li class="covered" data-hits="1" data-linenumber="59">
+
+ <li class="covered" data-hits="1" data-linenumber="66">
<span class="hits">1</span>
-
+
<code class="ruby"> def validate!(param, options)</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="60">
-
-
+
+ <li class="covered" data-hits="67" data-linenumber="67">
+ <span class="hits">67</span>
+
<code class="ruby"> options.each do |key, value|</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="61">
-
-
+
+ <li class="covered" data-hits="38" data-linenumber="68">
+ <span class="hits">38</span>
+
<code class="ruby"> case key</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="62">
-
-
+
+ <li class="never" data-hits="" data-linenumber="69">
+
+
<code class="ruby"> when :required</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="63">
-
-
+
+ <li class="covered" data-hits="3" data-linenumber="70">
+ <span class="hits">3</span>
+
<code class="ruby"> raise InvalidParameterError if value && param.nil?</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="64">
-
-
+
+ <li class="never" data-hits="" data-linenumber="71">
+
+
<code class="ruby"> when :blank</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="65">
-
-
+
+ <li class="never" data-hits="" data-linenumber="72">
+
+
<code class="ruby"> raise InvalidParameterError if !value && case param</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="66">
-
-
+
+ <li class="never" data-hits="" data-linenumber="73">
+
+
<code class="ruby"> when String</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="67">
-
-
+
+ <li class="covered" data-hits="1" data-linenumber="74">
+ <span class="hits">1</span>
+
<code class="ruby"> !(/\S/ === param)</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="68">
-
-
+
+ <li class="never" data-hits="" data-linenumber="75">
+
+
<code class="ruby"> when Array, Hash</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="69">
-
-
+
+ <li class="covered" data-hits="2" data-linenumber="76">
+ <span class="hits">2</span>
+
<code class="ruby"> param.empty?</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="70">
-
-
+
+ <li class="never" data-hits="" data-linenumber="77">
+
+
<code class="ruby"> else</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="71">
-
-
+
+ <li class="covered" data-hits="1" data-linenumber="78">
+ <span class="hits">1</span>
+
<code class="ruby"> param.nil?</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="72">
-
-
+
+ <li class="covered" data-hits="5" data-linenumber="79">
+ <span class="hits">5</span>
+
<code class="ruby"> end</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="73">
-
-
+
+ <li class="never" data-hits="" data-linenumber="80">
+
+
<code class="ruby"> when :is</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="74">
-
-
+
+ <li class="covered" data-hits="2" data-linenumber="81">
+ <span class="hits">2</span>
+
<code class="ruby"> raise InvalidParameterError unless value === param</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="75">
-
-
+
+ <li class="never" data-hits="" data-linenumber="82">
+
+
<code class="ruby"> when :in, :within, :range</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="76">
-
-
+
+ <li class="never" data-hits="" data-linenumber="83">
+
+
<code class="ruby"> raise InvalidParameterError unless param.nil? || case value</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="77">
-
-
+
+ <li class="never" data-hits="" data-linenumber="84">
+
+
<code class="ruby"> when Range</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="78">
-
-
+
+ <li class="covered" data-hits="4" data-linenumber="85">
+ <span class="hits">4</span>
+
<code class="ruby"> value.include?(param)</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="79">
-
-
+
+ <li class="never" data-hits="" data-linenumber="86">
+
+
<code class="ruby"> else</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="80">
-
-
+
+ <li class="covered" data-hits="2" data-linenumber="87">
+ <span class="hits">2</span>
+
<code class="ruby"> Array(value).include?(param)</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="81">
-
-
+
+ <li class="covered" data-hits="6" data-linenumber="88">
+ <span class="hits">6</span>
+
<code class="ruby"> end</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="82">
-
-
+
+ <li class="never" data-hits="" data-linenumber="89">
+
+
<code class="ruby"> when :min</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="83">
-
-
+
+ <li class="covered" data-hits="2" data-linenumber="90">
+ <span class="hits">2</span>
+
<code class="ruby"> raise InvalidParameterError unless param.nil? || value <= param</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="84">
-
-
+
+ <li class="never" data-hits="" data-linenumber="91">
+
+
<code class="ruby"> when :max</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="85">
-
-
+
+ <li class="covered" data-hits="2" data-linenumber="92">
+ <span class="hits">2</span>
+
<code class="ruby"> raise InvalidParameterError unless param.nil? || value >= param</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="86">
-
-
+
+ <li class="never" data-hits="" data-linenumber="93">
+
+
<code class="ruby"> when :min_length</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="87">
-
-
+
+ <li class="covered" data-hits="1" data-linenumber="94">
+ <span class="hits">1</span>
+
<code class="ruby"> raise InvalidParameterError unless param.nil? || value <= param.length</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="88">
-
-
+
+ <li class="never" data-hits="" data-linenumber="95">
+
+
<code class="ruby"> when :max_length</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="89">
-
-
+
+ <li class="covered" data-hits="3" data-linenumber="96">
+ <span class="hits">3</span>
+
<code class="ruby"> raise InvalidParameterError unless param.nil? || value >= param.length</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="90">
-
-
+
+ <li class="never" data-hits="" data-linenumber="97">
+
+
<code class="ruby"> end</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="91">
-
-
+
+ <li class="never" data-hits="" data-linenumber="98">
+
+
<code class="ruby"> end</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="92">
-
-
+
+ <li class="never" data-hits="" data-linenumber="99">
+
+
<code class="ruby"> end</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="93">
-
-
+
+ <li class="never" data-hits="" data-linenumber="100">
+
+
<code class="ruby"></code>
</li>
-
- <li class="never" data-hits="" data-linenumber="94">
-
-
+
+ <li class="never" data-hits="" data-linenumber="101">
+
+
<code class="ruby"> # ActiveSupport #present? and #blank? without patching Object</code>
</li>
-
- <li class="covered" data-hits="1" data-linenumber="95">
+
+ <li class="covered" data-hits="1" data-linenumber="102">
<span class="hits">1</span>
-
+
<code class="ruby"> def present?(object)</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="96">
-
-
+
+ <li class="covered" data-hits="21" data-linenumber="103">
+ <span class="hits">21</span>
+
<code class="ruby"> !blank?(object)</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="97">
-
-
+
+ <li class="never" data-hits="" data-linenumber="104">
+
+
<code class="ruby"> end</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="98">
-
-
+
+ <li class="never" data-hits="" data-linenumber="105">
+
+
<code class="ruby"></code>
</li>
-
- <li class="covered" data-hits="1" data-linenumber="99">
+
+ <li class="covered" data-hits="1" data-linenumber="106">
<span class="hits">1</span>
-
+
<code class="ruby"> def blank?(object)</code>
</li>
-
- <li class="missed" data-hits="0" data-linenumber="100">
-
-
+
+ <li class="covered" data-hits="21" data-linenumber="107">
+ <span class="hits">21</span>
+
<code class="ruby"> object.respond_to?(:empty?) ? object.empty? : !object</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="101">
-
-
+
+ <li class="never" data-hits="" data-linenumber="108">
+
+
<code class="ruby"> end</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="102">
-
-
+
+ <li class="never" data-hits="" data-linenumber="109">
+
+
<code class="ruby"> end</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="103">
-
-
+
+ <li class="never" data-hits="" data-linenumber="110">
+
+
<code class="ruby"></code>
</li>
-
- <li class="covered" data-hits="1" data-linenumber="104">
+
+ <li class="covered" data-hits="1" data-linenumber="111">
<span class="hits">1</span>
-
+
<code class="ruby"> helpers Param</code>
</li>
-
- <li class="never" data-hits="" data-linenumber="105">
-
-
+
+ <li class="never" data-hits="" data-linenumber="112">
+
+
<code class="ruby">end</code>
</li>
-
+
</ol>
</pre>
</div>
-
- <div class="source_table" id="95bc1568394aeedcc2389ae1301b3fd7e08bf109">
- <div class="header">
- <h3>lib/sinatra/param/version.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>3</b> relevant lines.
- <span class="green"><b>3</b> lines covered</span> and
- <span class="red"><b>0</b> lines missed.</span>
- </div>
- </div>
-
- <pre>
- <ol>
-
- <li class="covered" data-hits="1" data-linenumber="1">
- <span class="hits">1</span>
-
- <code class="ruby">module Sinatra</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="2">
- <span class="hits">1</span>
-
- <code class="ruby"> module Param</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="3">
- <span class="hits">1</span>
-
- <code class="ruby"> VERSION = "0.1.1"</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="4">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="5">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
+
</div>
</div>
</body>
</html>