675 lines
32 KiB
HTML
675 lines
32 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
|
|
<head>
|
|
<title>spec/unit/reporter_spec.rb</title>
|
|
<link href="./assets/0.2.3/screen.css" media="all" rel="stylesheet" type="text/css" />
|
|
<link href="./assets/0.2.3/print.css" media="print" rel="stylesheet" type="text/css" />
|
|
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
|
|
<script type="text/javascript" src="./assets/0.2.3/rcov.js"></script>
|
|
</head>
|
|
<body>
|
|
<h1>Astute C0 Coverage Information - Simploco - RCov</h1>
|
|
<h2>spec/unit/reporter_spec.rb</h2>
|
|
|
|
<div class="report_table_wrapper">
|
|
<table class='report' id='report_table'>
|
|
<thead>
|
|
<tr>
|
|
<th class="left_align">Name</th>
|
|
<th class="right_align">Total Lines</th>
|
|
<th class="right_align">Lines of Code</th>
|
|
<th class="left_align">Total Coverage</th>
|
|
<th class="left_align">Code Coverage</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td class="left_align"><a href="spec-unit-reporter_spec_rb.html">spec/unit/reporter_spec.rb</a></td>
|
|
<td class='right_align'><tt>205</tt></td>
|
|
<td class='right_align'><tt>126</tt></td>
|
|
<td class="left_align"><div class="percent_graph_legend"><tt class=''>100.00%</tt></div>
|
|
<div class="percent_graph">
|
|
<div class="covered" style="width:100px"></div>
|
|
<div class="uncovered" style="width:0px"></div>
|
|
</div></td>
|
|
<td class="left_align"><div class="percent_graph_legend"><tt class=''>100.00%</tt></div>
|
|
<div class="percent_graph">
|
|
<div class="covered" style="width:100px"></div>
|
|
<div class="uncovered" style="width:0px"></div>
|
|
</div></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<h3>Key</h3>
|
|
|
|
<div class="key"><pre><span class='marked'>Code reported as executed by Ruby looks like this...</span><span class='marked1'>and this: this line is also marked as covered.</span><span class='inferred'>Lines considered as run by rcov, but not reported by Ruby, look like this,</span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics).</span><span class='uncovered'>Finally, here's a line marked as not executed.</span></pre></div>
|
|
|
|
<h3>Coverage Details</h3>
|
|
|
|
<table class="details">
|
|
<tbody>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line2">2</a> # Copyright 2013 Mirantis, Inc.</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line3">3</a> #</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line4">4</a> # Licensed under the Apache License, Version 2.0 (the "License"); you may</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line5">5</a> # not use this file except in compliance with the License. You may obtain</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line6">6</a> # a copy of the License at</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line7">7</a> #</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line8">8</a> # http://www.apache.org/licenses/LICENSE-2.0</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line9">9</a> #</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line10">10</a> # Unless required by applicable law or agreed to in writing, software</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line11">11</a> # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line12">12</a> # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line13">13</a> # License for the specific language governing permissions and limitations</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line14">14</a> # under the License.</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line15">15</a> </pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line16">16</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line17">17</a> require File.join(File.dirname(__FILE__), '../spec_helper')</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line18">18</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line19">19</a> include Astute</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line20">20</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line21">21</a> describe "ProxyReporter" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line22">22</a> context "Instance of ProxyReporter class" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line23">23</a> before :each do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line24">24</a> @msg = {'nodes' => [{'status' => 'ready', 'uid' => '1'}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line25">25</a> @msg_pr = {'nodes' => [@msg['nodes'][0],</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line26">26</a> {'status' => 'deploying', 'uid' => '2',</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line27">27</a> 'progress' => 54}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line28">28</a> @up_reporter = mock('up_reporter')</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line29">29</a> @reporter = ProxyReporter.new(@up_reporter)</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line30">30</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line31">31</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line32">32</a> it "reports first-come data" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line33">33</a> @up_reporter.expects(:report).with(@msg)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line34">34</a> @reporter.report(@msg)</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line35">35</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line36">36</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line37">37</a> it "does not report the same message" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line38">38</a> @up_reporter.expects(:report).with(@msg).once</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line39">39</a> 5.times { @reporter.report(@msg) }</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line40">40</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line41">41</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line42">42</a> it "reports only updated node" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line43">43</a> updated_node = @msg_pr['nodes'][1]</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line44">44</a> expected_msg = {'nodes' => [updated_node]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line45">45</a> @up_reporter.expects(:report).with(@msg)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line46">46</a> @up_reporter.expects(:report).with(expected_msg)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line47">47</a> @reporter.report(@msg)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line48">48</a> @reporter.report(@msg_pr)</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line49">49</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line50">50</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line51">51</a> it "reports only if progress value is greater" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line52">52</a> msg1 = {'nodes' => [{'status' => 'deploying', 'uid' => '1', 'progress' => 54},</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line53">53</a> {'status' => 'deploying', 'uid' => '2', 'progress' => 54}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line54">54</a> msg2 = Marshal.load(Marshal.dump(msg1))</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line55">55</a> msg2['nodes'][1]['progress'] = 100</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line56">56</a> msg2['nodes'][1]['status'] = 'ready'</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line57">57</a> updated_node = msg2['nodes'][1]</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line58">58</a> expected_msg = {'nodes' => [updated_node]}</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line59">59</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line60">60</a> @up_reporter.expects(:report).with(msg1)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line61">61</a> @up_reporter.expects(:report).with(expected_msg)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line62">62</a> @reporter.report(msg1)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line63">63</a> @reporter.report(msg2)</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line64">64</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line65">65</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line66">66</a> it "raises exception if wrong key passed" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line67">67</a> @msg['nodes'][0]['ups'] = 'some_value'</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line68">68</a> lambda {@reporter.report(@msg)}.should raise_error</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line69">69</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line70">70</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line71">71</a> it "adjusts progress to 100 if passed greater" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line72">72</a> input_msg = {'nodes' => [{'uid' => 1, 'status' => 'deploying', 'progress' => 120}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line73">73</a> expected_msg = {'nodes' => [{'uid' => 1, 'status' => 'deploying', 'progress' => 100}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line74">74</a> @up_reporter.expects(:report).with(expected_msg)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line75">75</a> @reporter.report(input_msg)</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line76">76</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line77">77</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line78">78</a> it "adjusts progress to 0 if passed less" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line79">79</a> input_msg = {'nodes' => [{'uid' => 1, 'status' => 'deploying', 'progress' => -20}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line80">80</a> expected_msg = {'nodes' => [{'uid' => 1, 'status' => 'deploying', 'progress' => 0}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line81">81</a> @up_reporter.expects(:report).with(expected_msg)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line82">82</a> @reporter.report(input_msg)</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line83">83</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line84">84</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line85">85</a> it "adjusts progress to 100 if status provisioned and no progress given" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line86">86</a> input_msg = {'nodes' => [{'uid' => 1, 'status' => 'provisioned'}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line87">87</a> expected_msg = {'nodes' => [{'uid' => 1, 'status' => 'provisioned', 'progress' => 100}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line88">88</a> @up_reporter.expects(:report).with(expected_msg)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line89">89</a> @reporter.report(input_msg)</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line90">90</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line91">91</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line92">92</a> it "adjusts progress to 100 if status ready and no progress given" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line93">93</a> input_msg = {'nodes' => [{'uid' => 1, 'status' => 'ready'}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line94">94</a> expected_msg = {'nodes' => [{'uid' => 1, 'status' => 'ready', 'progress' => 100}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line95">95</a> @up_reporter.expects(:report).with(expected_msg)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line96">96</a> @reporter.report(input_msg)</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line97">97</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line98">98</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line99">99</a> it "adjusts progress to 100 if status provisioned with progress" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line100">100</a> input_msg = {'nodes' => [{'uid' => 1, 'status' => 'provisioned', 'progress' => 50}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line101">101</a> expected_msg = {'nodes' => [{'uid' => 1, 'status' => 'provisioned', 'progress' => 100}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line102">102</a> @up_reporter.expects(:report).with(expected_msg)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line103">103</a> @reporter.report(input_msg)</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line104">104</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line105">105</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line106">106</a> it "adjusts progress to 100 if status ready with progress" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line107">107</a> input_msg = {'nodes' => [{'uid' => 1, 'status' => 'ready', 'progress' => 50}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line108">108</a> expected_msg = {'nodes' => [{'uid' => 1, 'status' => 'ready', 'progress' => 100}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line109">109</a> @up_reporter.expects(:report).with(expected_msg)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line110">110</a> @reporter.report(input_msg)</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line111">111</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line112">112</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line113">113</a> it "does not report if node was in ready, and trying to set is deploying" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line114">114</a> msg1 = {'nodes' => [{'uid' => 1, 'status' => 'ready'}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line115">115</a> msg2 = {'nodes' => [{'uid' => 2, 'status' => 'ready'}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line116">116</a> msg3 = {'nodes' => [{'uid' => 1, 'status' => 'deploying', 'progress' => 100}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line117">117</a> @up_reporter.expects(:report).with(msg1)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line118">118</a> @up_reporter.expects(:report).with(msg2)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line119">119</a> @up_reporter.expects(:report).never</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line120">120</a> @reporter.report(msg1)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line121">121</a> @reporter.report(msg2)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line122">122</a> 5.times { @reporter.report(msg3) }</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line123">123</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line124">124</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line125">125</a> it "reports even not all keys provided" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line126">126</a> msg1 = {'nodes' => [{'uid' => 1, 'status' => 'deploying'}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line127">127</a> msg2 = {'nodes' => [{'uid' => 2, 'status' => 'ready'}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line128">128</a> @up_reporter.expects(:report).with(msg1)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line129">129</a> @up_reporter.expects(:report).with(msg2)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line130">130</a> @reporter.report(msg1)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line131">131</a> @reporter.report(msg2)</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line132">132</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line133">133</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line134">134</a> it "raises exception if progress provided and no status" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line135">135</a> msg1 = {'nodes' => [{'uid' => 1, 'status' => 'ready'}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line136">136</a> msg2 = {'nodes' => [{'uid' => 1, 'progress' => 100}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line137">137</a> @up_reporter.expects(:report).with(msg1)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line138">138</a> @up_reporter.expects(:report).never</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line139">139</a> @reporter.report(msg1)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line140">140</a> lambda {@reporter.report(msg2)}.should raise_error</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line141">141</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line142">142</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line143">143</a> it "raises exception if status of node is not supported" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line144">144</a> msg1 = {'nodes' => [{'uid' => 1, 'status' => 'hah'}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line145">145</a> @up_reporter.expects(:report).never</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line146">146</a> lambda {@reporter.report(msg1)}.should raise_error</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line147">147</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line148">148</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line149">149</a> it "some other attrs are valid and passed" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line150">150</a> msg1 = {'nodes' => [{'uid' => 1, 'status' => 'deploying'}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line151">151</a> msg2 = {'status' => 'error', 'error_type' => 'deploy',</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line152">152</a> 'nodes' => [{'uid' => 2, 'status' => 'error', 'message' => 'deploy'}]}</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line153">153</a> @up_reporter.expects(:report).with(msg1)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line154">154</a> @up_reporter.expects(:report).with(msg2)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line155">155</a> @reporter.report(msg1)</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line156">156</a> @reporter.report(msg2)</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line157">157</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line158">158</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line159">159</a> it "reports if status is greater" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line160">160</a> msgs = [{'nodes' => [{'uid' => 1, 'status' => 'provisioned'}]},</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line161">161</a> {'nodes' => [{'uid' => 1, 'status' => 'provisioning'}]},</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line162">162</a> {'nodes' => [{'uid' => 1, 'status' => 'ready'}]},</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line163">163</a> {'nodes' => [{'uid' => 1, 'status' => 'error'}]}]</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line164">164</a> @up_reporter.expects(:report).with(msgs[0])</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line165">165</a> @up_reporter.expects(:report).with(msgs[2])</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line166">166</a> @up_reporter.expects(:report).with(msgs[3])</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line167">167</a> msgs.each {|msg| @reporter.report(msg)}</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line168">168</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line169">169</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line170">170</a> it "doesn't update progress if it less than previous progress with same status" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line171">171</a> msgs = [{'nodes' => [{'uid' => 1, 'status' => 'provisioning', 'progress' => 50}]},</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line172">172</a> {'nodes' => [{'uid' => 1, 'status' => 'provisioning', 'progress' => 10}]},</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line173">173</a> {'nodes' => [{'uid' => 1, 'status' => 'deploying', 'progress' => 50}]},</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line174">174</a> {'nodes' => [{'uid' => 1, 'status' => 'deploying', 'progress' => 10}]}]</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line175">175</a> @up_reporter.expects(:report).with(msgs[0])</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line176">176</a> @up_reporter.expects(:report).with(msgs[2])</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line177">177</a> @up_reporter.expects(:report).never</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line178">178</a> msgs.each {|msg| @reporter.report(msg)}</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line179">179</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line180">180</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line181">181</a> it "updates progress if it less than previous progress when changing status" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line182">182</a> msgs = [{'nodes' => [{'uid' => 1, 'status' => 'provisioning', 'progress' => 50}]},</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line183">183</a> {'nodes' => [{'uid' => 1, 'status' => 'provisioned'}]},</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line184">184</a> {'nodes' => [{'uid' => 1, 'status' => 'provisioned', 'progress' => 100}]},</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line185">185</a> {'nodes' => [{'uid' => 1, 'status' => 'deploying', 'progress' => 0}]}]</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line186">186</a> @up_reporter.expects(:report).with(msgs[0])</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line187">187</a> @up_reporter.expects(:report).with(msgs[2])</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line188">188</a> @up_reporter.expects(:report).with(msgs[3])</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line189">189</a> @up_reporter.expects(:report).never</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line190">190</a> msgs.each {|msg| @reporter.report(msg)}</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line191">191</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line192">192</a> </pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line193">193</a> it "doesn't forget previously reported attributes" do</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line194">194</a> msgs = [{'nodes' => [{'uid' => 1, 'status' => 'provisioning', 'progress' => 50}]},</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line195">195</a> {'nodes' => [{'uid' => 1, 'status' => 'provisioning'}]},</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line196">196</a> {'nodes' => [{'uid' => 1, 'status' => 'provisioning', 'key' => 'value'}]},</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line197">197</a> {'nodes' => [{'uid' => 1, 'status' => 'provisioning', 'progress' => 0}]},</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line198">198</a> ]</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line199">199</a> @up_reporter.expects(:report).with(msgs[0])</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line200">200</a> @up_reporter.expects(:report).with(msgs[2])</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line201">201</a> @up_reporter.expects(:report).never</pre></td>
|
|
</tr>
|
|
<tr class="marked">
|
|
<td><pre><a name="line202">202</a> msgs.each {|msg| @reporter.report(msg)}</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line203">203</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line204">204</a> </pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line205">205</a> end</pre></td>
|
|
</tr>
|
|
<tr class="inferred">
|
|
<td><pre><a name="line206">206</a> end</pre></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>Generated on 2013-07-19 12:05:31 +0400 with <a href="https://github.com/fguillen/simplecov-rcov">SimpleCov-RCov 0.2.3</a></p>
|
|
|
|
</body>
|
|
</html>
|