standup_md 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +63 -9
- data/Rakefile +11 -28
- data/doc/README_md.html +55 -7
- data/doc/StandupMD.html +331 -266
- data/doc/StandupMD/Cli.html +27 -22
- data/doc/created.rid +5 -8
- data/doc/index.html +54 -13
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +11 -275
- data/lib/standup_md.rb +71 -32
- data/lib/standup_md/cli.rb +10 -6
- data/lib/standup_md/version.rb +2 -2
- metadata +2 -5
- data/doc/TestCli.html +0 -792
- data/doc/TestHelper.html +0 -282
- data/doc/TestStandupMD.html +0 -1354
data/doc/TestHelper.html
DELETED
@@ -1,282 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>module TestHelper - RDoc Documentation</title>
|
8
|
-
|
9
|
-
<script type="text/javascript">
|
10
|
-
var rdoc_rel_prefix = "./";
|
11
|
-
var index_rel_prefix = "./";
|
12
|
-
</script>
|
13
|
-
|
14
|
-
<script src="./js/navigation.js" defer></script>
|
15
|
-
<script src="./js/search.js" defer></script>
|
16
|
-
<script src="./js/search_index.js" defer></script>
|
17
|
-
<script src="./js/searcher.js" defer></script>
|
18
|
-
<script src="./js/darkfish.js" defer></script>
|
19
|
-
|
20
|
-
<link href="./css/fonts.css" rel="stylesheet">
|
21
|
-
<link href="./css/rdoc.css" rel="stylesheet">
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
<body id="top" role="document" class="module">
|
27
|
-
<nav role="navigation">
|
28
|
-
<div id="project-navigation">
|
29
|
-
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
30
|
-
<h2>
|
31
|
-
<a href="./index.html" rel="home">Home</a>
|
32
|
-
</h2>
|
33
|
-
|
34
|
-
<div id="table-of-contents-navigation">
|
35
|
-
<a href="./table_of_contents.html#pages">Pages</a>
|
36
|
-
<a href="./table_of_contents.html#classes">Classes</a>
|
37
|
-
<a href="./table_of_contents.html#methods">Methods</a>
|
38
|
-
</div>
|
39
|
-
</div>
|
40
|
-
|
41
|
-
<div id="search-section" role="search" class="project-section initially-hidden">
|
42
|
-
<form action="#" method="get" accept-charset="utf-8">
|
43
|
-
<div id="search-field-wrapper">
|
44
|
-
<input id="search-field" role="combobox" aria-label="Search"
|
45
|
-
aria-autocomplete="list" aria-controls="search-results"
|
46
|
-
type="text" name="search" placeholder="Search" spellcheck="false"
|
47
|
-
title="Type to search, Up and Down to navigate, Enter to load">
|
48
|
-
</div>
|
49
|
-
|
50
|
-
<ul id="search-results" aria-label="Search Results"
|
51
|
-
aria-busy="false" aria-expanded="false"
|
52
|
-
aria-atomic="false" class="initially-hidden"></ul>
|
53
|
-
</form>
|
54
|
-
</div>
|
55
|
-
|
56
|
-
</div>
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
<div id="class-metadata">
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
<!-- Method Quickref -->
|
66
|
-
<div id="method-list-section" class="nav-section">
|
67
|
-
<h3>Methods</h3>
|
68
|
-
|
69
|
-
<ul class="link-list" role="directory">
|
70
|
-
|
71
|
-
<li ><a href="#method-i-cli">#cli</a>
|
72
|
-
|
73
|
-
<li ><a href="#method-i-create_standup_file">#create_standup_file</a>
|
74
|
-
|
75
|
-
<li ><a href="#method-i-fixtures">#fixtures</a>
|
76
|
-
|
77
|
-
<li ><a href="#method-i-standup">#standup</a>
|
78
|
-
|
79
|
-
</ul>
|
80
|
-
</div>
|
81
|
-
|
82
|
-
</div>
|
83
|
-
</nav>
|
84
|
-
|
85
|
-
<main role="main" aria-labelledby="module-TestHelper">
|
86
|
-
<h1 id="module-TestHelper" class="module">
|
87
|
-
module TestHelper
|
88
|
-
</h1>
|
89
|
-
|
90
|
-
<section class="description">
|
91
|
-
|
92
|
-
<p>Module to include in tests that provides helper functions.</p>
|
93
|
-
|
94
|
-
</section>
|
95
|
-
|
96
|
-
|
97
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
108
|
-
<header>
|
109
|
-
<h3>Public Instance Methods</h3>
|
110
|
-
</header>
|
111
|
-
|
112
|
-
|
113
|
-
<div id="method-i-cli" class="method-detail ">
|
114
|
-
|
115
|
-
<div class="method-heading">
|
116
|
-
<span class="method-name">cli</span><span
|
117
|
-
class="method-args">(options = [])</span>
|
118
|
-
|
119
|
-
<span class="method-click-advice">click to toggle source</span>
|
120
|
-
|
121
|
-
</div>
|
122
|
-
|
123
|
-
|
124
|
-
<div class="method-description">
|
125
|
-
|
126
|
-
<p>Creates instance of <code>Cli</code>.</p>
|
127
|
-
|
128
|
-
<p>@param [Array] options Parsed by <code>getopts</code></p>
|
129
|
-
|
130
|
-
<p>@return [StandupMD::Cli]</p>
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
<div class="method-source-code" id="cli-source">
|
136
|
-
<pre><span class="ruby-comment"># File test/test_helper.rb, line 58</span>
|
137
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cli</span>(<span class="ruby-identifier">options</span> = [])
|
138
|
-
<span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">Cli</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">options</span>)
|
139
|
-
<span class="ruby-keyword">end</span></pre>
|
140
|
-
</div>
|
141
|
-
|
142
|
-
</div>
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
</div>
|
148
|
-
|
149
|
-
|
150
|
-
<div id="method-i-create_standup_file" class="method-detail ">
|
151
|
-
|
152
|
-
<div class="method-heading">
|
153
|
-
<span class="method-name">create_standup_file</span><span
|
154
|
-
class="method-args">(file, fixture = 'previous_entry')</span>
|
155
|
-
|
156
|
-
<span class="method-click-advice">click to toggle source</span>
|
157
|
-
|
158
|
-
</div>
|
159
|
-
|
160
|
-
|
161
|
-
<div class="method-description">
|
162
|
-
|
163
|
-
<p>Creates the standup file with entries.</p>
|
164
|
-
|
165
|
-
<p>@param [String] file The name of the file to create</p>
|
166
|
-
|
167
|
-
<p>@param [String] fixture Fixture to add to the file</p>
|
168
|
-
|
169
|
-
<p>@return [Hash]</p>
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
<div class="method-source-code" id="create_standup_file-source">
|
175
|
-
<pre><span class="ruby-comment"># File test/test_helper.rb, line 42</span>
|
176
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">create_standup_file</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">fixture</span> = <span class="ruby-string">'previous_entry'</span>)
|
177
|
-
<span class="ruby-identifier">dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">file</span>)
|
178
|
-
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir</span>(<span class="ruby-identifier">dir</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">dir</span>)
|
179
|
-
<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">file</span>, <span class="ruby-string">'w'</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
180
|
-
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">fixtures</span>[<span class="ruby-identifier">fixture</span>]
|
181
|
-
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span>
|
182
|
-
<span class="ruby-identifier">f</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">fixtures</span>[<span class="ruby-string">'current_entry'</span>]
|
183
|
-
<span class="ruby-keyword">end</span>
|
184
|
-
<span class="ruby-keyword">end</span></pre>
|
185
|
-
</div>
|
186
|
-
|
187
|
-
</div>
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
</div>
|
193
|
-
|
194
|
-
|
195
|
-
<div id="method-i-fixtures" class="method-detail ">
|
196
|
-
|
197
|
-
<div class="method-heading">
|
198
|
-
<span class="method-name">fixtures</span><span
|
199
|
-
class="method-args">()</span>
|
200
|
-
|
201
|
-
<span class="method-click-advice">click to toggle source</span>
|
202
|
-
|
203
|
-
</div>
|
204
|
-
|
205
|
-
|
206
|
-
<div class="method-description">
|
207
|
-
|
208
|
-
<p>Reads the fixtures in as a hash.</p>
|
209
|
-
|
210
|
-
<p>@return [Hash]</p>
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
<div class="method-source-code" id="fixtures-source">
|
216
|
-
<pre><span class="ruby-comment"># File test/test_helper.rb, line 15</span>
|
217
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">fixtures</span>
|
218
|
-
<span class="ruby-ivar">@test_helper_fixtures</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load</span>(<span class="ruby-constant">ERB</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(
|
219
|
-
<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">__dir__</span>, <span class="ruby-string">'fixtures.yml.erb'</span>)
|
220
|
-
)).<span class="ruby-identifier">result</span>(<span class="ruby-identifier">binding</span>))
|
221
|
-
<span class="ruby-keyword">end</span></pre>
|
222
|
-
</div>
|
223
|
-
|
224
|
-
</div>
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
</div>
|
230
|
-
|
231
|
-
|
232
|
-
<div id="method-i-standup" class="method-detail ">
|
233
|
-
|
234
|
-
<div class="method-heading">
|
235
|
-
<span class="method-name">standup</span><span
|
236
|
-
class="method-args">(directory, args = {})</span>
|
237
|
-
|
238
|
-
<span class="method-click-advice">click to toggle source</span>
|
239
|
-
|
240
|
-
</div>
|
241
|
-
|
242
|
-
|
243
|
-
<div class="method-description">
|
244
|
-
|
245
|
-
<p>Creates <code>StandupUP</code> instance. Directory must be passed, usually a subdirectory of <code>test</code>, so we don't overwrite the user's standup file.</p>
|
246
|
-
|
247
|
-
<p>@param [String] directory @param [Hash] args Optional hash of attributes to set</p>
|
248
|
-
|
249
|
-
<p>@return [StandupMD]</p>
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
<div class="method-source-code" id="standup-source">
|
255
|
-
<pre><span class="ruby-comment"># File test/test_helper.rb, line 29</span>
|
256
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">standup</span>(<span class="ruby-identifier">directory</span>, <span class="ruby-identifier">args</span> = {})
|
257
|
-
<span class="ruby-identifier">args</span>[<span class="ruby-string">'directory'</span>] = <span class="ruby-identifier">directory</span>
|
258
|
-
<span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">load</span>(<span class="ruby-identifier">args</span>)
|
259
|
-
<span class="ruby-keyword">end</span></pre>
|
260
|
-
</div>
|
261
|
-
|
262
|
-
</div>
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
</div>
|
268
|
-
|
269
|
-
|
270
|
-
</section>
|
271
|
-
|
272
|
-
</section>
|
273
|
-
|
274
|
-
</main>
|
275
|
-
|
276
|
-
|
277
|
-
<footer id="validator-badges" role="contentinfo">
|
278
|
-
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
279
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.1.
|
280
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
281
|
-
</footer>
|
282
|
-
|
data/doc/TestStandupMD.html
DELETED
@@ -1,1354 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<meta charset="UTF-8">
|
6
|
-
|
7
|
-
<title>class TestStandupMD - RDoc Documentation</title>
|
8
|
-
|
9
|
-
<script type="text/javascript">
|
10
|
-
var rdoc_rel_prefix = "./";
|
11
|
-
var index_rel_prefix = "./";
|
12
|
-
</script>
|
13
|
-
|
14
|
-
<script src="./js/navigation.js" defer></script>
|
15
|
-
<script src="./js/search.js" defer></script>
|
16
|
-
<script src="./js/search_index.js" defer></script>
|
17
|
-
<script src="./js/searcher.js" defer></script>
|
18
|
-
<script src="./js/darkfish.js" defer></script>
|
19
|
-
|
20
|
-
<link href="./css/fonts.css" rel="stylesheet">
|
21
|
-
<link href="./css/rdoc.css" rel="stylesheet">
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
<body id="top" role="document" class="class">
|
27
|
-
<nav role="navigation">
|
28
|
-
<div id="project-navigation">
|
29
|
-
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
30
|
-
<h2>
|
31
|
-
<a href="./index.html" rel="home">Home</a>
|
32
|
-
</h2>
|
33
|
-
|
34
|
-
<div id="table-of-contents-navigation">
|
35
|
-
<a href="./table_of_contents.html#pages">Pages</a>
|
36
|
-
<a href="./table_of_contents.html#classes">Classes</a>
|
37
|
-
<a href="./table_of_contents.html#methods">Methods</a>
|
38
|
-
</div>
|
39
|
-
</div>
|
40
|
-
|
41
|
-
<div id="search-section" role="search" class="project-section initially-hidden">
|
42
|
-
<form action="#" method="get" accept-charset="utf-8">
|
43
|
-
<div id="search-field-wrapper">
|
44
|
-
<input id="search-field" role="combobox" aria-label="Search"
|
45
|
-
aria-autocomplete="list" aria-controls="search-results"
|
46
|
-
type="text" name="search" placeholder="Search" spellcheck="false"
|
47
|
-
title="Type to search, Up and Down to navigate, Enter to load">
|
48
|
-
</div>
|
49
|
-
|
50
|
-
<ul id="search-results" aria-label="Search Results"
|
51
|
-
aria-busy="false" aria-expanded="false"
|
52
|
-
aria-atomic="false" class="initially-hidden"></ul>
|
53
|
-
</form>
|
54
|
-
</div>
|
55
|
-
|
56
|
-
</div>
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
<div id="class-metadata">
|
61
|
-
|
62
|
-
<div id="parent-class-section" class="nav-section">
|
63
|
-
<h3>Parent</h3>
|
64
|
-
|
65
|
-
|
66
|
-
<p class="link">Test::Unit::TestCase
|
67
|
-
|
68
|
-
</div>
|
69
|
-
|
70
|
-
<div id="includes-section" class="nav-section">
|
71
|
-
<h3>Included Modules</h3>
|
72
|
-
|
73
|
-
<ul class="link-list">
|
74
|
-
|
75
|
-
|
76
|
-
<li><a class="include" href="TestHelper.html">TestHelper</a>
|
77
|
-
|
78
|
-
|
79
|
-
</ul>
|
80
|
-
</div>
|
81
|
-
|
82
|
-
|
83
|
-
<!-- Method Quickref -->
|
84
|
-
<div id="method-list-section" class="nav-section">
|
85
|
-
<h3>Methods</h3>
|
86
|
-
|
87
|
-
<ul class="link-list" role="directory">
|
88
|
-
|
89
|
-
<li ><a href="#method-i-setup">#setup</a>
|
90
|
-
|
91
|
-
<li ><a href="#method-i-teardown">#teardown</a>
|
92
|
-
|
93
|
-
<li ><a href="#method-i-test_VERSION">#test_VERSION</a>
|
94
|
-
|
95
|
-
<li ><a href="#method-i-test_all_previous_entries">#test_all_previous_entries</a>
|
96
|
-
|
97
|
-
<li ><a href="#method-i-test_bullet_character">#test_bullet_character</a>
|
98
|
-
|
99
|
-
<li ><a href="#method-i-test_class_load">#test_class_load</a>
|
100
|
-
|
101
|
-
<li ><a href="#method-i-test_current_entry">#test_current_entry</a>
|
102
|
-
|
103
|
-
<li ><a href="#method-i-test_current_entry_tasks">#test_current_entry_tasks</a>
|
104
|
-
|
105
|
-
<li ><a href="#method-i-test_current_header">#test_current_header</a>
|
106
|
-
|
107
|
-
<li ><a href="#method-i-test_directory">#test_directory</a>
|
108
|
-
|
109
|
-
<li ><a href="#method-i-test_entry_previously_added-3F">#test_entry_previously_added?</a>
|
110
|
-
|
111
|
-
<li ><a href="#method-i-test_file">#test_file</a>
|
112
|
-
|
113
|
-
<li ><a href="#method-i-test_file_name_format">#test_file_name_format</a>
|
114
|
-
|
115
|
-
<li ><a href="#method-i-test_file_written-3F">#test_file_written?</a>
|
116
|
-
|
117
|
-
<li ><a href="#method-i-test_header_date_format">#test_header_date_format</a>
|
118
|
-
|
119
|
-
<li ><a href="#method-i-test_header_depth">#test_header_depth</a>
|
120
|
-
|
121
|
-
<li ><a href="#method-i-test_impediments">#test_impediments</a>
|
122
|
-
|
123
|
-
<li ><a href="#method-i-test_impediments_header">#test_impediments_header</a>
|
124
|
-
|
125
|
-
<li ><a href="#method-i-test_load">#test_load</a>
|
126
|
-
|
127
|
-
<li ><a href="#method-i-test_notes">#test_notes</a>
|
128
|
-
|
129
|
-
<li ><a href="#method-i-test_notes_header">#test_notes_header</a>
|
130
|
-
|
131
|
-
<li ><a href="#method-i-test_previous_entry_tasks">#test_previous_entry_tasks</a>
|
132
|
-
|
133
|
-
<li ><a href="#method-i-test_previous_file_when_current_and_previous_month_do_not_exist">#test_previous_file_when_current_and_previous_month_do_not_exist</a>
|
134
|
-
|
135
|
-
<li ><a href="#method-i-test_previous_file_when_current_month_file_does_not_exist_but_previous_does">#test_previous_file_when_current_month_file_does_not_exist_but_previous_does</a>
|
136
|
-
|
137
|
-
<li ><a href="#method-i-test_previous_file_when_entry_exists_for_today">#test_previous_file_when_entry_exists_for_today</a>
|
138
|
-
|
139
|
-
<li ><a href="#method-i-test_previous_header">#test_previous_header</a>
|
140
|
-
|
141
|
-
<li ><a href="#method-i-test_reload">#test_reload</a>
|
142
|
-
|
143
|
-
<li ><a href="#method-i-test_setting_attributes_via_block">#test_setting_attributes_via_block</a>
|
144
|
-
|
145
|
-
<li ><a href="#method-i-test_sub_header_depth">#test_sub_header_depth</a>
|
146
|
-
|
147
|
-
<li ><a href="#method-i-test_sub_header_order">#test_sub_header_order</a>
|
148
|
-
|
149
|
-
<li ><a href="#method-i-test_write">#test_write</a>
|
150
|
-
|
151
|
-
</ul>
|
152
|
-
</div>
|
153
|
-
|
154
|
-
</div>
|
155
|
-
</nav>
|
156
|
-
|
157
|
-
<main role="main" aria-labelledby="class-TestStandupMD">
|
158
|
-
<h1 id="class-TestStandupMD" class="class">
|
159
|
-
class TestStandupMD
|
160
|
-
</h1>
|
161
|
-
|
162
|
-
<section class="description">
|
163
|
-
|
164
|
-
<p>The test suite for <code>StandupMD</code>.</p>
|
165
|
-
|
166
|
-
</section>
|
167
|
-
|
168
|
-
|
169
|
-
<section id="5Buntitled-5D" class="documentation-section">
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
180
|
-
<header>
|
181
|
-
<h3>Public Instance Methods</h3>
|
182
|
-
</header>
|
183
|
-
|
184
|
-
|
185
|
-
<div id="method-i-setup" class="method-detail ">
|
186
|
-
|
187
|
-
<div class="method-heading">
|
188
|
-
<span class="method-name">setup</span><span
|
189
|
-
class="method-args">()</span>
|
190
|
-
|
191
|
-
<span class="method-click-advice">click to toggle source</span>
|
192
|
-
|
193
|
-
</div>
|
194
|
-
|
195
|
-
|
196
|
-
<div class="method-description">
|
197
|
-
|
198
|
-
<p>Set working directory, current month's file, and last month's file, which will be created and destroyed for each test.</p>
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
<div class="method-source-code" id="setup-source">
|
204
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 12</span>
|
205
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">setup</span>
|
206
|
-
<span class="ruby-ivar">@workdir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">__dir__</span>, <span class="ruby-string">'files'</span>)
|
207
|
-
<span class="ruby-ivar">@current_test_file</span> =
|
208
|
-
<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@workdir</span>, <span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-string">'%Y_%m.md'</span>))
|
209
|
-
<span class="ruby-ivar">@previous_month_test_file</span> =
|
210
|
-
<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@workdir</span>, <span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span>.<span class="ruby-identifier">prev_month</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-string">'%Y_%m.md'</span>))
|
211
|
-
<span class="ruby-keyword">end</span></pre>
|
212
|
-
</div>
|
213
|
-
|
214
|
-
</div>
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
</div>
|
220
|
-
|
221
|
-
|
222
|
-
<div id="method-i-teardown" class="method-detail ">
|
223
|
-
|
224
|
-
<div class="method-heading">
|
225
|
-
<span class="method-name">teardown</span><span
|
226
|
-
class="method-args">()</span>
|
227
|
-
|
228
|
-
<span class="method-click-advice">click to toggle source</span>
|
229
|
-
|
230
|
-
</div>
|
231
|
-
|
232
|
-
|
233
|
-
<div class="method-description">
|
234
|
-
|
235
|
-
<p>Destroy the working directory and its contents.</p>
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
<div class="method-source-code" id="teardown-source">
|
241
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 22</span>
|
242
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">teardown</span>
|
243
|
-
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_r</span>(<span class="ruby-ivar">@workdir</span>) <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-ivar">@workdir</span>)
|
244
|
-
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm</span>(<span class="ruby-ivar">@current_test_file</span>) <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-ivar">@current_test_file</span>)
|
245
|
-
<span class="ruby-keyword">end</span></pre>
|
246
|
-
</div>
|
247
|
-
|
248
|
-
</div>
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
</div>
|
254
|
-
|
255
|
-
|
256
|
-
<div id="method-i-test_VERSION" class="method-detail ">
|
257
|
-
|
258
|
-
<div class="method-heading">
|
259
|
-
<span class="method-name">test_VERSION</span><span
|
260
|
-
class="method-args">()</span>
|
261
|
-
|
262
|
-
<span class="method-click-advice">click to toggle source</span>
|
263
|
-
|
264
|
-
</div>
|
265
|
-
|
266
|
-
|
267
|
-
<div class="method-description">
|
268
|
-
|
269
|
-
<p><code>StandupMD::VERSION</code> should consist of three integers separated by dots.</p>
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
<div class="method-source-code" id="test_VERSION-source">
|
275
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 63</span>
|
276
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_VERSION</span>
|
277
|
-
<span class="ruby-identifier">assert_match</span>(<span class="ruby-regexp">/\d+\.\d+.\d+/</span>, <span class="ruby-operator">::</span><span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span>)
|
278
|
-
<span class="ruby-keyword">end</span></pre>
|
279
|
-
</div>
|
280
|
-
|
281
|
-
</div>
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
</div>
|
287
|
-
|
288
|
-
|
289
|
-
<div id="method-i-test_all_previous_entries" class="method-detail ">
|
290
|
-
|
291
|
-
<div class="method-heading">
|
292
|
-
<span class="method-name">test_all_previous_entries</span><span
|
293
|
-
class="method-args">()</span>
|
294
|
-
|
295
|
-
<span class="method-click-advice">click to toggle source</span>
|
296
|
-
|
297
|
-
</div>
|
298
|
-
|
299
|
-
|
300
|
-
<div class="method-description">
|
301
|
-
|
302
|
-
<p>Should be all entries before the current entry.</p>
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
<div class="method-source-code" id="test_all_previous_entries-source">
|
308
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 130</span>
|
309
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_all_previous_entries</span>
|
310
|
-
<span class="ruby-identifier">create_standup_file</span>(<span class="ruby-ivar">@current_test_file</span>)
|
311
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
312
|
-
<span class="ruby-identifier">assert_equal</span>(
|
313
|
-
<span class="ruby-identifier">fixtures</span>[<span class="ruby-string">'previous_entry_tasks'</span>],
|
314
|
-
<span class="ruby-identifier">su</span>.<span class="ruby-identifier">all_previous_entries</span>
|
315
|
-
)
|
316
|
-
<span class="ruby-keyword">end</span></pre>
|
317
|
-
</div>
|
318
|
-
|
319
|
-
</div>
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
</div>
|
325
|
-
|
326
|
-
|
327
|
-
<div id="method-i-test_bullet_character" class="method-detail ">
|
328
|
-
|
329
|
-
<div class="method-heading">
|
330
|
-
<span class="method-name">test_bullet_character</span><span
|
331
|
-
class="method-args">()</span>
|
332
|
-
|
333
|
-
<span class="method-click-advice">click to toggle source</span>
|
334
|
-
|
335
|
-
</div>
|
336
|
-
|
337
|
-
|
338
|
-
<div class="method-description">
|
339
|
-
|
340
|
-
<p>Should be able to change the bullet character but should raise if not * or -</p>
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
<div class="method-source-code" id="test_bullet_character-source">
|
346
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 202</span>
|
347
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_bullet_character</span>
|
348
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
349
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">'-'</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">bullet_character</span>)
|
350
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">bullet_character</span> = <span class="ruby-string">'*'</span> }
|
351
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">'*'</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">bullet_character</span>)
|
352
|
-
<span class="ruby-identifier">assert_raise</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">bullet_character</span> = <span class="ruby-string">'>'</span> }
|
353
|
-
<span class="ruby-keyword">end</span></pre>
|
354
|
-
</div>
|
355
|
-
|
356
|
-
</div>
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
</div>
|
362
|
-
|
363
|
-
|
364
|
-
<div id="method-i-test_class_load" class="method-detail ">
|
365
|
-
|
366
|
-
<div class="method-heading">
|
367
|
-
<span class="method-name">test_class_load</span><span
|
368
|
-
class="method-args">()</span>
|
369
|
-
|
370
|
-
<span class="method-click-advice">click to toggle source</span>
|
371
|
-
|
372
|
-
</div>
|
373
|
-
|
374
|
-
|
375
|
-
<div class="method-description">
|
376
|
-
|
377
|
-
<p>Make sure load accepts a hash of attributes, sets them, and returns an instance of itself.</p>
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
<div class="method-source-code" id="test_class_load-source">
|
383
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 30</span>
|
384
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_class_load</span>
|
385
|
-
<span class="ruby-identifier">assert_nothing_raised</span> <span class="ruby-keyword">do</span>
|
386
|
-
<span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">load</span>({<span class="ruby-value">directory:</span> <span class="ruby-ivar">@workdir</span>, <span class="ruby-value">bullet_character:</span> <span class="ruby-string">'*'</span>})
|
387
|
-
<span class="ruby-keyword">end</span>
|
388
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">load</span>({<span class="ruby-value">directory:</span> <span class="ruby-ivar">@workdir</span>, <span class="ruby-value">bullet_character:</span> <span class="ruby-string">'*'</span>})
|
389
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-ivar">@workdir</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">directory</span>)
|
390
|
-
<span class="ruby-identifier">assert_instance_of</span>(<span class="ruby-constant">StandupMD</span>, <span class="ruby-identifier">su</span>)
|
391
|
-
<span class="ruby-keyword">end</span></pre>
|
392
|
-
</div>
|
393
|
-
|
394
|
-
</div>
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
</div>
|
400
|
-
|
401
|
-
|
402
|
-
<div id="method-i-test_current_entry" class="method-detail ">
|
403
|
-
|
404
|
-
<div class="method-heading">
|
405
|
-
<span class="method-name">test_current_entry</span><span
|
406
|
-
class="method-args">()</span>
|
407
|
-
|
408
|
-
<span class="method-click-advice">click to toggle source</span>
|
409
|
-
|
410
|
-
</div>
|
411
|
-
|
412
|
-
|
413
|
-
<div class="method-description">
|
414
|
-
|
415
|
-
<p><code>current_entry</code> should be a hash. If <code>file</code> already has an entry for today, it will be read and used as <code>current_entry</code>. If there is no entry for today, one should be generated from scaffolding.</p>
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
<div class="method-source-code" id="test_current_entry-source">
|
421
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 119</span>
|
422
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_current_entry</span>
|
423
|
-
<span class="ruby-identifier">create_standup_file</span>(<span class="ruby-ivar">@current_test_file</span>)
|
424
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
425
|
-
<span class="ruby-identifier">assert_equal</span>(
|
426
|
-
<span class="ruby-identifier">fixtures</span>[<span class="ruby-string">'current_entry_tasks'</span>][<span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-string">'%Y-%m-%d'</span>)],
|
427
|
-
<span class="ruby-identifier">su</span>.<span class="ruby-identifier">current_entry</span>
|
428
|
-
)
|
429
|
-
<span class="ruby-keyword">end</span></pre>
|
430
|
-
</div>
|
431
|
-
|
432
|
-
</div>
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
</div>
|
438
|
-
|
439
|
-
|
440
|
-
<div id="method-i-test_current_entry_tasks" class="method-detail ">
|
441
|
-
|
442
|
-
<div class="method-heading">
|
443
|
-
<span class="method-name">test_current_entry_tasks</span><span
|
444
|
-
class="method-args">()</span>
|
445
|
-
|
446
|
-
<span class="method-click-advice">click to toggle source</span>
|
447
|
-
|
448
|
-
</div>
|
449
|
-
|
450
|
-
|
451
|
-
<div class="method-description">
|
452
|
-
|
453
|
-
<p>Should be able to add tasks for current_entry.</p>
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
<div class="method-source-code" id="test_current_entry_tasks-source">
|
459
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 165</span>
|
460
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_current_entry_tasks</span>
|
461
|
-
<span class="ruby-identifier">create_standup_file</span>(<span class="ruby-ivar">@current_test_file</span>)
|
462
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
463
|
-
<span class="ruby-identifier">assert_equal</span>([<span class="ruby-string">"<!-- ADD TODAY'S WORK HERE -->"</span>], <span class="ruby-identifier">su</span>.<span class="ruby-identifier">current_entry_tasks</span>)
|
464
|
-
<span class="ruby-identifier">assert_raise</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">current_entry_tasks</span> = <span class="ruby-string">'not array'</span> }
|
465
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">current_entry_tasks</span> = [<span class="ruby-string">'An array'</span>] }
|
466
|
-
<span class="ruby-identifier">assert_equal</span>([<span class="ruby-string">"An array"</span>], <span class="ruby-identifier">su</span>.<span class="ruby-identifier">current_entry_tasks</span>)
|
467
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">current_entry_tasks</span> <span class="ruby-operator"><<</span> <span class="ruby-string">'Another task'</span> }
|
468
|
-
<span class="ruby-identifier">assert_includes</span>(<span class="ruby-identifier">su</span>.<span class="ruby-identifier">current_entry_tasks</span>, <span class="ruby-string">'Another task'</span>)
|
469
|
-
<span class="ruby-keyword">end</span></pre>
|
470
|
-
</div>
|
471
|
-
|
472
|
-
</div>
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
</div>
|
478
|
-
|
479
|
-
|
480
|
-
<div id="method-i-test_current_header" class="method-detail ">
|
481
|
-
|
482
|
-
<div class="method-heading">
|
483
|
-
<span class="method-name">test_current_header</span><span
|
484
|
-
class="method-args">()</span>
|
485
|
-
|
486
|
-
<span class="method-click-advice">click to toggle source</span>
|
487
|
-
|
488
|
-
</div>
|
489
|
-
|
490
|
-
|
491
|
-
<div class="method-description">
|
492
|
-
|
493
|
-
<p>Should be changeable and used as the header for <code>current_entry</code></p>
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
<div class="method-source-code" id="test_current_header-source">
|
499
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 267</span>
|
500
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_current_header</span>
|
501
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
502
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">'Current'</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">current_header</span>)
|
503
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">current_header</span> = <span class="ruby-string">'Today'</span> }
|
504
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">'Today'</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">current_header</span>)
|
505
|
-
<span class="ruby-keyword">end</span></pre>
|
506
|
-
</div>
|
507
|
-
|
508
|
-
</div>
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
</div>
|
514
|
-
|
515
|
-
|
516
|
-
<div id="method-i-test_directory" class="method-detail ">
|
517
|
-
|
518
|
-
<div class="method-heading">
|
519
|
-
<span class="method-name">test_directory</span><span
|
520
|
-
class="method-args">()</span>
|
521
|
-
|
522
|
-
<span class="method-click-advice">click to toggle source</span>
|
523
|
-
|
524
|
-
</div>
|
525
|
-
|
526
|
-
|
527
|
-
<div class="method-description">
|
528
|
-
|
529
|
-
<p>Directory should default be settable, and where standup files are read from.</p>
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
<div class="method-source-code" id="test_directory-source">
|
535
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 141</span>
|
536
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_directory</span>
|
537
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
538
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-ivar">@workdir</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">directory</span>)
|
539
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">directory</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@workdir</span>, <span class="ruby-string">'TEST'</span>) }
|
540
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@workdir</span>, <span class="ruby-string">'TEST'</span>), <span class="ruby-identifier">su</span>.<span class="ruby-identifier">directory</span>)
|
541
|
-
<span class="ruby-identifier">assert</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">su</span>.<span class="ruby-identifier">directory</span>))
|
542
|
-
<span class="ruby-keyword">end</span></pre>
|
543
|
-
</div>
|
544
|
-
|
545
|
-
</div>
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
</div>
|
551
|
-
|
552
|
-
|
553
|
-
<div id="method-i-test_entry_previously_added-3F" class="method-detail ">
|
554
|
-
|
555
|
-
<div class="method-heading">
|
556
|
-
<span class="method-name">test_entry_previously_added?</span><span
|
557
|
-
class="method-args">()</span>
|
558
|
-
|
559
|
-
<span class="method-click-advice">click to toggle source</span>
|
560
|
-
|
561
|
-
</div>
|
562
|
-
|
563
|
-
|
564
|
-
<div class="method-description">
|
565
|
-
|
566
|
-
<p>Should be true if <code>current_entry</code> was in the file at the time it was read.</p>
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
<div class="method-source-code" id="test_entry_previously_added-3F-source">
|
572
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 314</span>
|
573
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_entry_previously_added?</span>
|
574
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
575
|
-
<span class="ruby-identifier">refute</span>(<span class="ruby-identifier">su</span>.<span class="ruby-identifier">entry_previously_added?</span>)
|
576
|
-
<span class="ruby-identifier">create_standup_file</span>(<span class="ruby-ivar">@current_test_file</span>)
|
577
|
-
<span class="ruby-identifier">su</span>.<span class="ruby-identifier">load</span>
|
578
|
-
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">su</span>.<span class="ruby-identifier">entry_previously_added?</span>)
|
579
|
-
<span class="ruby-keyword">end</span></pre>
|
580
|
-
</div>
|
581
|
-
|
582
|
-
</div>
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
</div>
|
588
|
-
|
589
|
-
|
590
|
-
<div id="method-i-test_file" class="method-detail ">
|
591
|
-
|
592
|
-
<div class="method-heading">
|
593
|
-
<span class="method-name">test_file</span><span
|
594
|
-
class="method-args">()</span>
|
595
|
-
|
596
|
-
<span class="method-click-advice">click to toggle source</span>
|
597
|
-
|
598
|
-
</div>
|
599
|
-
|
600
|
-
|
601
|
-
<div class="method-description">
|
602
|
-
|
603
|
-
<p>The file name should equal file_name_format parsed by Date.strftime. The default is Date.today.strftime('%Y_%m.md')</p>
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
<div class="method-source-code" id="test_file-source">
|
609
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 70</span>
|
610
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_file</span>
|
611
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
612
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-ivar">@current_test_file</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">file</span>)
|
613
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">file_name_format</span> = <span class="ruby-string">'%y_%m.markdown'</span> }
|
614
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">load</span> }
|
615
|
-
<span class="ruby-identifier">assert_equal</span>(
|
616
|
-
<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-ivar">@workdir</span>, <span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-string">'%y_%m.markdown'</span>)),
|
617
|
-
<span class="ruby-identifier">su</span>.<span class="ruby-identifier">file</span>
|
618
|
-
)
|
619
|
-
<span class="ruby-keyword">end</span></pre>
|
620
|
-
</div>
|
621
|
-
|
622
|
-
</div>
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
</div>
|
628
|
-
|
629
|
-
|
630
|
-
<div id="method-i-test_file_name_format" class="method-detail ">
|
631
|
-
|
632
|
-
<div class="method-heading">
|
633
|
-
<span class="method-name">test_file_name_format</span><span
|
634
|
-
class="method-args">()</span>
|
635
|
-
|
636
|
-
<span class="method-click-advice">click to toggle source</span>
|
637
|
-
|
638
|
-
</div>
|
639
|
-
|
640
|
-
|
641
|
-
<div class="method-description">
|
642
|
-
|
643
|
-
<p>Should be changeable, and return a string parsed by <code>strftime</code>.</p>
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
<div class="method-source-code" id="test_file_name_format-source">
|
649
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 248</span>
|
650
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_file_name_format</span>
|
651
|
-
<span class="ruby-identifier">create_standup_file</span>(<span class="ruby-ivar">@current_test_file</span>)
|
652
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
653
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">'%Y_%m.md'</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">file_name_format</span>)
|
654
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">file_name_format</span> = <span class="ruby-string">'%y_%m.markdown'</span> }
|
655
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">'%y_%m.markdown'</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">file_name_format</span>)
|
656
|
-
<span class="ruby-keyword">end</span></pre>
|
657
|
-
</div>
|
658
|
-
|
659
|
-
</div>
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
</div>
|
665
|
-
|
666
|
-
|
667
|
-
<div id="method-i-test_file_written-3F" class="method-detail ">
|
668
|
-
|
669
|
-
<div class="method-heading">
|
670
|
-
<span class="method-name">test_file_written?</span><span
|
671
|
-
class="method-args">()</span>
|
672
|
-
|
673
|
-
<span class="method-click-advice">click to toggle source</span>
|
674
|
-
|
675
|
-
</div>
|
676
|
-
|
677
|
-
|
678
|
-
<div class="method-description">
|
679
|
-
|
680
|
-
<p>Should be false when first instantiated, true after <code>write</code> is called.</p>
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
<div class="method-source-code" id="test_file_written-3F-source">
|
686
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 305</span>
|
687
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_file_written?</span>
|
688
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
689
|
-
<span class="ruby-identifier">refute</span>(<span class="ruby-identifier">su</span>.<span class="ruby-identifier">file_written?</span>)
|
690
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">write</span> }
|
691
|
-
<span class="ruby-identifier">assert</span>(<span class="ruby-identifier">su</span>.<span class="ruby-identifier">file_written?</span>)
|
692
|
-
<span class="ruby-keyword">end</span></pre>
|
693
|
-
</div>
|
694
|
-
|
695
|
-
</div>
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
</div>
|
701
|
-
|
702
|
-
|
703
|
-
<div id="method-i-test_header_date_format" class="method-detail ">
|
704
|
-
|
705
|
-
<div class="method-heading">
|
706
|
-
<span class="method-name">test_header_date_format</span><span
|
707
|
-
class="method-args">()</span>
|
708
|
-
|
709
|
-
<span class="method-click-advice">click to toggle source</span>
|
710
|
-
|
711
|
-
</div>
|
712
|
-
|
713
|
-
|
714
|
-
<div class="method-description">
|
715
|
-
|
716
|
-
<p>Should be changeable, and return a string parsed by <code>strftime</code>.</p>
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
<div class="method-source-code" id="test_header_date_format-source">
|
722
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 258</span>
|
723
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_header_date_format</span>
|
724
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
725
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">'%Y-%m-%d'</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">header_date_format</span>)
|
726
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">header_date_format</span> = <span class="ruby-string">'%y-%m-%d'</span> }
|
727
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">'%y-%m-%d'</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">header_date_format</span>)
|
728
|
-
<span class="ruby-keyword">end</span></pre>
|
729
|
-
</div>
|
730
|
-
|
731
|
-
</div>
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
</div>
|
737
|
-
|
738
|
-
|
739
|
-
<div id="method-i-test_header_depth" class="method-detail ">
|
740
|
-
|
741
|
-
<div class="method-heading">
|
742
|
-
<span class="method-name">test_header_depth</span><span
|
743
|
-
class="method-args">()</span>
|
744
|
-
|
745
|
-
<span class="method-click-advice">click to toggle source</span>
|
746
|
-
|
747
|
-
</div>
|
748
|
-
|
749
|
-
|
750
|
-
<div class="method-description">
|
751
|
-
|
752
|
-
<p>Should be an integer between <code>1..5</code>, but not higher than <code>sub_header_depth</code>.</p>
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
<div class="method-source-code" id="test_header_depth-source">
|
758
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 212</span>
|
759
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_header_depth</span>
|
760
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>, <span class="ruby-value">sub_header_depth:</span> <span class="ruby-value">4</span>)
|
761
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value">1</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">header_depth</span>)
|
762
|
-
<span class="ruby-identifier">assert_raise</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">header_depth</span> = <span class="ruby-value">6</span> }
|
763
|
-
<span class="ruby-identifier">assert_raise</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">header_depth</span> = <span class="ruby-value">0</span> }
|
764
|
-
<span class="ruby-identifier">assert_raise</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">header_depth</span> = <span class="ruby-value">5</span> }
|
765
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">header_depth</span> = <span class="ruby-value">3</span> }
|
766
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value">3</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">header_depth</span>)
|
767
|
-
<span class="ruby-keyword">end</span></pre>
|
768
|
-
</div>
|
769
|
-
|
770
|
-
</div>
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
</div>
|
776
|
-
|
777
|
-
|
778
|
-
<div id="method-i-test_impediments" class="method-detail ">
|
779
|
-
|
780
|
-
<div class="method-heading">
|
781
|
-
<span class="method-name">test_impediments</span><span
|
782
|
-
class="method-args">()</span>
|
783
|
-
|
784
|
-
<span class="method-click-advice">click to toggle source</span>
|
785
|
-
|
786
|
-
</div>
|
787
|
-
|
788
|
-
|
789
|
-
<div class="method-description">
|
790
|
-
|
791
|
-
<p>Should be able to add impediments to the array.</p>
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
<div class="method-source-code" id="test_impediments-source">
|
797
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 178</span>
|
798
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_impediments</span>
|
799
|
-
<span class="ruby-identifier">create_standup_file</span>(<span class="ruby-ivar">@current_test_file</span>)
|
800
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
801
|
-
<span class="ruby-identifier">assert_equal</span>([<span class="ruby-string">"None"</span>], <span class="ruby-identifier">su</span>.<span class="ruby-identifier">impediments</span>)
|
802
|
-
<span class="ruby-identifier">assert_raise</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">impediments</span> = <span class="ruby-string">''</span>}
|
803
|
-
<span class="ruby-identifier">new_impediments</span> = [<span class="ruby-string">'Impediment 1'</span>]
|
804
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">impediments</span> = <span class="ruby-identifier">new_impediments</span> }
|
805
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">new_impediments</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">impediments</span>)
|
806
|
-
<span class="ruby-keyword">end</span></pre>
|
807
|
-
</div>
|
808
|
-
|
809
|
-
</div>
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
</div>
|
815
|
-
|
816
|
-
|
817
|
-
<div id="method-i-test_impediments_header" class="method-detail ">
|
818
|
-
|
819
|
-
<div class="method-heading">
|
820
|
-
<span class="method-name">test_impediments_header</span><span
|
821
|
-
class="method-args">()</span>
|
822
|
-
|
823
|
-
<span class="method-click-advice">click to toggle source</span>
|
824
|
-
|
825
|
-
</div>
|
826
|
-
|
827
|
-
|
828
|
-
<div class="method-description">
|
829
|
-
|
830
|
-
<p>Should be changeable and used as the header for <code>impediments</code></p>
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
<div class="method-source-code" id="test_impediments_header-source">
|
836
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 285</span>
|
837
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_impediments_header</span>
|
838
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
839
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">'Impediments'</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">impediments_header</span>)
|
840
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">impediments_header</span> = <span class="ruby-string">'Hold Ups'</span> }
|
841
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">'Hold Ups'</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">impediments_header</span>)
|
842
|
-
<span class="ruby-keyword">end</span></pre>
|
843
|
-
</div>
|
844
|
-
|
845
|
-
</div>
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
</div>
|
851
|
-
|
852
|
-
|
853
|
-
<div id="method-i-test_load" class="method-detail ">
|
854
|
-
|
855
|
-
<div class="method-heading">
|
856
|
-
<span class="method-name">test_load</span><span
|
857
|
-
class="method-args">()</span>
|
858
|
-
|
859
|
-
<span class="method-click-advice">click to toggle source</span>
|
860
|
-
|
861
|
-
</div>
|
862
|
-
|
863
|
-
|
864
|
-
<div class="method-description">
|
865
|
-
|
866
|
-
<p>Should load instance variables.</p>
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
<div class="method-source-code" id="test_load-source">
|
872
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 332</span>
|
873
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_load</span>
|
874
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">directory</span> = <span class="ruby-ivar">@workdir</span> }
|
875
|
-
<span class="ruby-identifier">assert_nil</span>(<span class="ruby-identifier">su</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-string">'@today'</span>))
|
876
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">load</span> }
|
877
|
-
<span class="ruby-identifier">refute_nil</span>(<span class="ruby-identifier">su</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-string">'@today'</span>))
|
878
|
-
<span class="ruby-keyword">end</span></pre>
|
879
|
-
</div>
|
880
|
-
|
881
|
-
</div>
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
</div>
|
887
|
-
|
888
|
-
|
889
|
-
<div id="method-i-test_notes" class="method-detail ">
|
890
|
-
|
891
|
-
<div class="method-heading">
|
892
|
-
<span class="method-name">test_notes</span><span
|
893
|
-
class="method-args">()</span>
|
894
|
-
|
895
|
-
<span class="method-click-advice">click to toggle source</span>
|
896
|
-
|
897
|
-
</div>
|
898
|
-
|
899
|
-
|
900
|
-
<div class="method-description">
|
901
|
-
|
902
|
-
<p>Should be able to add notes to the array.</p>
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
<div class="method-source-code" id="test_notes-source">
|
908
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 190</span>
|
909
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_notes</span>
|
910
|
-
<span class="ruby-identifier">create_standup_file</span>(<span class="ruby-ivar">@current_test_file</span>)
|
911
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
912
|
-
<span class="ruby-identifier">assert_equal</span>([], <span class="ruby-identifier">su</span>.<span class="ruby-identifier">notes</span>)
|
913
|
-
<span class="ruby-identifier">assert_raise</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">notes</span> = <span class="ruby-string">''</span>}
|
914
|
-
<span class="ruby-identifier">new_notes</span> = [<span class="ruby-string">'Note 1'</span>]
|
915
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">notes</span> = <span class="ruby-identifier">new_notes</span> }
|
916
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">new_notes</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">notes</span>)
|
917
|
-
<span class="ruby-keyword">end</span></pre>
|
918
|
-
</div>
|
919
|
-
|
920
|
-
</div>
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
</div>
|
926
|
-
|
927
|
-
|
928
|
-
<div id="method-i-test_notes_header" class="method-detail ">
|
929
|
-
|
930
|
-
<div class="method-heading">
|
931
|
-
<span class="method-name">test_notes_header</span><span
|
932
|
-
class="method-args">()</span>
|
933
|
-
|
934
|
-
<span class="method-click-advice">click to toggle source</span>
|
935
|
-
|
936
|
-
</div>
|
937
|
-
|
938
|
-
|
939
|
-
<div class="method-description">
|
940
|
-
|
941
|
-
<p>Should be changeable and used as the header for <code>notes</code></p>
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
<div class="method-source-code" id="test_notes_header-source">
|
947
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 294</span>
|
948
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_notes_header</span>
|
949
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
950
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">'Notes'</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">notes_header</span>)
|
951
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">notes_header</span> = <span class="ruby-string">'Remember'</span> }
|
952
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">'Remember'</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">notes_header</span>)
|
953
|
-
<span class="ruby-keyword">end</span></pre>
|
954
|
-
</div>
|
955
|
-
|
956
|
-
</div>
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
</div>
|
962
|
-
|
963
|
-
|
964
|
-
<div id="method-i-test_previous_entry_tasks" class="method-detail ">
|
965
|
-
|
966
|
-
<div class="method-heading">
|
967
|
-
<span class="method-name">test_previous_entry_tasks</span><span
|
968
|
-
class="method-args">()</span>
|
969
|
-
|
970
|
-
<span class="method-click-advice">click to toggle source</span>
|
971
|
-
|
972
|
-
</div>
|
973
|
-
|
974
|
-
|
975
|
-
<div class="method-description">
|
976
|
-
|
977
|
-
<p>Should be an array of previous entry's current entry.</p>
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
<div class="method-source-code" id="test_previous_entry_tasks-source">
|
983
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 235</span>
|
984
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_previous_entry_tasks</span>
|
985
|
-
<span class="ruby-identifier">create_standup_file</span>(<span class="ruby-ivar">@current_test_file</span>)
|
986
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
987
|
-
<span class="ruby-identifier">assert_equal</span>([<span class="ruby-string">"Test task 2"</span>, <span class="ruby-string">"Test task 4"</span>], <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_entry_tasks</span>)
|
988
|
-
<span class="ruby-identifier">assert_raise</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_entry_tasks</span> = <span class="ruby-string">'not array'</span> }
|
989
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_entry_tasks</span> = [<span class="ruby-string">'An array'</span>] }
|
990
|
-
<span class="ruby-identifier">assert_equal</span>([<span class="ruby-string">"An array"</span>], <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_entry_tasks</span>)
|
991
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_entry_tasks</span> <span class="ruby-operator"><<</span> <span class="ruby-string">'Another task'</span> }
|
992
|
-
<span class="ruby-identifier">assert_includes</span>(<span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_entry_tasks</span>, <span class="ruby-string">'Another task'</span>)
|
993
|
-
<span class="ruby-keyword">end</span></pre>
|
994
|
-
</div>
|
995
|
-
|
996
|
-
</div>
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
</div>
|
1002
|
-
|
1003
|
-
|
1004
|
-
<div id="method-i-test_previous_file_when_current_and_previous_month_do_not_exist" class="method-detail ">
|
1005
|
-
|
1006
|
-
<div class="method-heading">
|
1007
|
-
<span class="method-name">test_previous_file_when_current_and_previous_month_do_not_exist</span><span
|
1008
|
-
class="method-args">()</span>
|
1009
|
-
|
1010
|
-
<span class="method-click-advice">click to toggle source</span>
|
1011
|
-
|
1012
|
-
</div>
|
1013
|
-
|
1014
|
-
|
1015
|
-
<div class="method-description">
|
1016
|
-
|
1017
|
-
<p>When neither last month's file, nor this month's file exist, previous_file should be an empty string.</p>
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
<div class="method-source-code" id="test_previous_file_when_current_and_previous_month_do_not_exist-source">
|
1023
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 84</span>
|
1024
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_previous_file_when_current_and_previous_month_do_not_exist</span>
|
1025
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
1026
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">''</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_file</span>)
|
1027
|
-
<span class="ruby-keyword">end</span></pre>
|
1028
|
-
</div>
|
1029
|
-
|
1030
|
-
</div>
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
</div>
|
1036
|
-
|
1037
|
-
|
1038
|
-
<div id="method-i-test_previous_file_when_current_month_file_does_not_exist_but_previous_does" class="method-detail ">
|
1039
|
-
|
1040
|
-
<div class="method-heading">
|
1041
|
-
<span class="method-name">test_previous_file_when_current_month_file_does_not_exist_but_previous_does</span><span
|
1042
|
-
class="method-args">()</span>
|
1043
|
-
|
1044
|
-
<span class="method-click-advice">click to toggle source</span>
|
1045
|
-
|
1046
|
-
</div>
|
1047
|
-
|
1048
|
-
|
1049
|
-
<div class="method-description">
|
1050
|
-
|
1051
|
-
<p>When last month's file exists, but this month's doesn't or is empty, previous_file should equal last menth's file.</p>
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
<div class="method-source-code" id="test_previous_file_when_current_month_file_does_not_exist_but_previous_does-source">
|
1057
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 92</span>
|
1058
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_previous_file_when_current_month_file_does_not_exist_but_previous_does</span>
|
1059
|
-
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-ivar">@workdir</span>)
|
1060
|
-
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">touch</span>(<span class="ruby-ivar">@previous_month_test_file</span>)
|
1061
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
1062
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-ivar">@previous_month_test_file</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_file</span>)
|
1063
|
-
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">touch</span>(<span class="ruby-ivar">@current_test_file</span>)
|
1064
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">load</span> }
|
1065
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
1066
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-ivar">@previous_month_test_file</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_file</span>)
|
1067
|
-
<span class="ruby-keyword">end</span></pre>
|
1068
|
-
</div>
|
1069
|
-
|
1070
|
-
</div>
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
</div>
|
1076
|
-
|
1077
|
-
|
1078
|
-
<div id="method-i-test_previous_file_when_entry_exists_for_today" class="method-detail ">
|
1079
|
-
|
1080
|
-
<div class="method-heading">
|
1081
|
-
<span class="method-name">test_previous_file_when_entry_exists_for_today</span><span
|
1082
|
-
class="method-args">()</span>
|
1083
|
-
|
1084
|
-
<span class="method-click-advice">click to toggle source</span>
|
1085
|
-
|
1086
|
-
</div>
|
1087
|
-
|
1088
|
-
|
1089
|
-
<div class="method-description">
|
1090
|
-
|
1091
|
-
<p>If there are previous entries for this month, previous file will be this month's file.</p>
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
<div class="method-source-code" id="test_previous_file_when_entry_exists_for_today-source">
|
1097
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 106</span>
|
1098
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_previous_file_when_entry_exists_for_today</span>
|
1099
|
-
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-ivar">@workdir</span>)
|
1100
|
-
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">touch</span>(<span class="ruby-ivar">@current_test_file</span>)
|
1101
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
1102
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">write</span> }
|
1103
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">load</span> }
|
1104
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-ivar">@current_test_file</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_file</span>)
|
1105
|
-
<span class="ruby-keyword">end</span></pre>
|
1106
|
-
</div>
|
1107
|
-
|
1108
|
-
</div>
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
</div>
|
1114
|
-
|
1115
|
-
|
1116
|
-
<div id="method-i-test_previous_header" class="method-detail ">
|
1117
|
-
|
1118
|
-
<div class="method-heading">
|
1119
|
-
<span class="method-name">test_previous_header</span><span
|
1120
|
-
class="method-args">()</span>
|
1121
|
-
|
1122
|
-
<span class="method-click-advice">click to toggle source</span>
|
1123
|
-
|
1124
|
-
</div>
|
1125
|
-
|
1126
|
-
|
1127
|
-
<div class="method-description">
|
1128
|
-
|
1129
|
-
<p>Should be changeable and used as the header for <code>previous_entry</code></p>
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
<div class="method-source-code" id="test_previous_header-source">
|
1135
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 276</span>
|
1136
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_previous_header</span>
|
1137
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
1138
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">'Previous'</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_header</span>)
|
1139
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_header</span> = <span class="ruby-string">'Yesterday'</span> }
|
1140
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">'Yesterday'</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">previous_header</span>)
|
1141
|
-
<span class="ruby-keyword">end</span></pre>
|
1142
|
-
</div>
|
1143
|
-
|
1144
|
-
</div>
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
</div>
|
1150
|
-
|
1151
|
-
|
1152
|
-
<div id="method-i-test_reload" class="method-detail ">
|
1153
|
-
|
1154
|
-
<div class="method-heading">
|
1155
|
-
<span class="method-name">test_reload</span><span
|
1156
|
-
class="method-args">()</span>
|
1157
|
-
|
1158
|
-
<span class="method-click-advice">click to toggle source</span>
|
1159
|
-
|
1160
|
-
</div>
|
1161
|
-
|
1162
|
-
|
1163
|
-
<div class="method-description">
|
1164
|
-
|
1165
|
-
<p>The reload method should exist, and is an alias of <code>load</code>.</p>
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
<div class="method-source-code" id="test_reload-source">
|
1171
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 41</span>
|
1172
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_reload</span>
|
1173
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
1174
|
-
<span class="ruby-identifier">assert_respond_to</span>(<span class="ruby-identifier">su</span>, <span class="ruby-value">:reload</span>)
|
1175
|
-
<span class="ruby-keyword">end</span></pre>
|
1176
|
-
</div>
|
1177
|
-
|
1178
|
-
</div>
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
</div>
|
1184
|
-
|
1185
|
-
|
1186
|
-
<div id="method-i-test_setting_attributes_via_block" class="method-detail ">
|
1187
|
-
|
1188
|
-
<div class="method-heading">
|
1189
|
-
<span class="method-name">test_setting_attributes_via_block</span><span
|
1190
|
-
class="method-args">()</span>
|
1191
|
-
|
1192
|
-
<span class="method-click-advice">click to toggle source</span>
|
1193
|
-
|
1194
|
-
</div>
|
1195
|
-
|
1196
|
-
|
1197
|
-
<div class="method-description">
|
1198
|
-
|
1199
|
-
<p>Attributes should be able to be set if you pass a block at instantiation.</p>
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
<div class="method-source-code" id="test_setting_attributes_via_block-source">
|
1205
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 48</span>
|
1206
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_setting_attributes_via_block</span>
|
1207
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">su</span><span class="ruby-operator">|</span> <span class="ruby-identifier">su</span>.<span class="ruby-identifier">directory</span> = <span class="ruby-ivar">@workdir</span> } }
|
1208
|
-
<span class="ruby-identifier">assert_raise</span> { <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">su</span><span class="ruby-operator">|</span> <span class="ruby-identifier">su</span>.<span class="ruby-identifier">not_a_method</span> = <span class="ruby-string">'something'</span>} }
|
1209
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
|
1210
|
-
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">directory</span> = <span class="ruby-ivar">@workdir</span>
|
1211
|
-
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">file_name_format</span> = <span class="ruby-string">'%y_%m.markdown'</span>
|
1212
|
-
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">bullet_character</span> = <span class="ruby-string">'*'</span>
|
1213
|
-
<span class="ruby-keyword">end</span>
|
1214
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-ivar">@workdir</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">directory</span>)
|
1215
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">'%y_%m.markdown'</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">file_name_format</span>)
|
1216
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-string">'*'</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">bullet_character</span>)
|
1217
|
-
<span class="ruby-keyword">end</span></pre>
|
1218
|
-
</div>
|
1219
|
-
|
1220
|
-
</div>
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
</div>
|
1226
|
-
|
1227
|
-
|
1228
|
-
<div id="method-i-test_sub_header_depth" class="method-detail ">
|
1229
|
-
|
1230
|
-
<div class="method-heading">
|
1231
|
-
<span class="method-name">test_sub_header_depth</span><span
|
1232
|
-
class="method-args">()</span>
|
1233
|
-
|
1234
|
-
<span class="method-click-advice">click to toggle source</span>
|
1235
|
-
|
1236
|
-
</div>
|
1237
|
-
|
1238
|
-
|
1239
|
-
<div class="method-description">
|
1240
|
-
|
1241
|
-
<p>Should be an integer between <code>2..6</code>, but not lower than <code>header_depth</code>.</p>
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
<div class="method-source-code" id="test_sub_header_depth-source">
|
1247
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 224</span>
|
1248
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_sub_header_depth</span>
|
1249
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
1250
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value">2</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">sub_header_depth</span>)
|
1251
|
-
<span class="ruby-identifier">assert_raise</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">sub_header_depth</span> = <span class="ruby-value">1</span> }
|
1252
|
-
<span class="ruby-identifier">assert_raise</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">sub_header_depth</span> = <span class="ruby-value">7</span> }
|
1253
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">sub_header_depth</span> = <span class="ruby-value">6</span> }
|
1254
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-value">6</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">sub_header_depth</span>)
|
1255
|
-
<span class="ruby-keyword">end</span></pre>
|
1256
|
-
</div>
|
1257
|
-
|
1258
|
-
</div>
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
</div>
|
1264
|
-
|
1265
|
-
|
1266
|
-
<div id="method-i-test_sub_header_order" class="method-detail ">
|
1267
|
-
|
1268
|
-
<div class="method-heading">
|
1269
|
-
<span class="method-name">test_sub_header_order</span><span
|
1270
|
-
class="method-args">()</span>
|
1271
|
-
|
1272
|
-
<span class="method-click-advice">click to toggle source</span>
|
1273
|
-
|
1274
|
-
</div>
|
1275
|
-
|
1276
|
-
|
1277
|
-
<div class="method-description">
|
1278
|
-
|
1279
|
-
<p>The order of the subheaders is changeable, but all elements must exist.</p>
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
<div class="method-source-code" id="test_sub_header_order-source">
|
1285
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 151</span>
|
1286
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_sub_header_order</span>
|
1287
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
1288
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-node">%w[previous current impediments notes]</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">sub_header_order</span>)
|
1289
|
-
<span class="ruby-identifier">assert_raise</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">sub_header_order</span> = <span class="ruby-string">'not array'</span> }
|
1290
|
-
<span class="ruby-identifier">assert_raise</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">sub_header_order</span> = <span class="ruby-node">%w[current impediments notes]</span> }
|
1291
|
-
<span class="ruby-identifier">assert_raise</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">sub_header_order</span> = <span class="ruby-node">%w[something, :previous, :current, :impediments, :notes]</span> }
|
1292
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">sub_header_order</span> = <span class="ruby-node">%w[current previous impediments notes]</span> }
|
1293
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-node">%w[current previous impediments notes]</span>, <span class="ruby-identifier">su</span>.<span class="ruby-identifier">sub_header_order</span>)
|
1294
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">sub_header_order</span> <span class="ruby-operator"><<</span> <span class="ruby-string">'Another task'</span> }
|
1295
|
-
<span class="ruby-identifier">assert_equal</span>(<span class="ruby-identifier">su</span>.<span class="ruby-identifier">sub_header_order</span>, <span class="ruby-node">%w[current previous impediments notes]</span>)
|
1296
|
-
<span class="ruby-keyword">end</span></pre>
|
1297
|
-
</div>
|
1298
|
-
|
1299
|
-
</div>
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
</div>
|
1305
|
-
|
1306
|
-
|
1307
|
-
<div id="method-i-test_write" class="method-detail ">
|
1308
|
-
|
1309
|
-
<div class="method-heading">
|
1310
|
-
<span class="method-name">test_write</span><span
|
1311
|
-
class="method-args">()</span>
|
1312
|
-
|
1313
|
-
<span class="method-click-advice">click to toggle source</span>
|
1314
|
-
|
1315
|
-
</div>
|
1316
|
-
|
1317
|
-
|
1318
|
-
<div class="method-description">
|
1319
|
-
|
1320
|
-
<p>Should write the file.</p>
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
<div class="method-source-code" id="test_write-source">
|
1326
|
-
<pre><span class="ruby-comment"># File test/standup_md_test.rb, line 324</span>
|
1327
|
-
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">test_write</span>
|
1328
|
-
<span class="ruby-identifier">su</span> = <span class="ruby-identifier">standup</span>(<span class="ruby-ivar">@workdir</span>)
|
1329
|
-
<span class="ruby-identifier">assert_nothing_raised</span> { <span class="ruby-identifier">su</span>.<span class="ruby-identifier">write</span> }
|
1330
|
-
<span class="ruby-identifier">assert</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-ivar">@current_test_file</span>))
|
1331
|
-
<span class="ruby-keyword">end</span></pre>
|
1332
|
-
</div>
|
1333
|
-
|
1334
|
-
</div>
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
</div>
|
1340
|
-
|
1341
|
-
|
1342
|
-
</section>
|
1343
|
-
|
1344
|
-
</section>
|
1345
|
-
|
1346
|
-
</main>
|
1347
|
-
|
1348
|
-
|
1349
|
-
<footer id="validator-badges" role="contentinfo">
|
1350
|
-
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
1351
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.1.
|
1352
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
1353
|
-
</footer>
|
1354
|
-
|