Skip to content

Commit 7ee1cc8

Browse files
authored
prep v2.0.0 release (#73)
* bump version to 2.0.0 * update CHANGELOG * update docs
1 parent 890e626 commit 7ee1cc8

18 files changed

+1591
-202
lines changed

CHANGELOG.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,65 +6,66 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
66

77
## Unreleased
88

9+
None
10+
11+
## [2.0.0](https://github.com/clarkedb/grift/releases/tag/v2.0.0) - 2022-03-14
12+
913
### Changed
1014

11-
* Dropped support for Ruby 2.5 and Ruby 2.6
12-
* To support keyword arguments, records of call arguments are no longer stored in simple arrays but in a custom Enumerable
15+
* Dropped support for Ruby 2.5 ([#69](https://github.com/clarkedb/grift/pull/69))
16+
* Dropped support for Ruby 2.6 ([#72](https://github.com/clarkedb/grift/pull/72))
17+
* To support keyword arguments, records of call arguments are no longer stored in simple arrays but in a custom Enumerable ([#72](https://github.com/clarkedb/grift/pull/72))
1318
+ This changes the way that your tests will interact with mock calls
1419
+ When before `calls` returned an array, it returns a `Grift::MockMethod::MockExecutions::MockArguments` object
1520
+ Migrating to maintain previous behavior just requires appending `.args` to `calls`
1621

1722
### Added
1823

19-
* Support for mocking private instance and class methods
20-
* Support for mocking methods that take positional and keyword arguments
24+
* Support for mocking private instance and class methods ([#68](https://github.com/clarkedb/grift/pull/68))
25+
* Support for mocking methods that take positional and keyword arguments ([#72](https://github.com/clarkedb/grift/pull/72))
2126

2227
### Fixed
2328

24-
* When mocking protected methods, the method now remains protected while mocked and after unmocking
25-
* When mocking inherited methods, the method goes back to the ancestor's definition after unmocking
29+
* When mocking protected methods, the method now remains protected while mocked and after unmocking ([#68](https://github.com/clarkedb/grift/pull/68))
30+
* When mocking inherited methods, the method goes back to the ancestor's definition after unmocking ([#69](https://github.com/clarkedb/grift/pull/69))
31+
* When mocking methods with keyword arugments in Ruby 3.x, no error is thrown ([#72](https://github.com/clarkedb/grift/pull/72))
2632

2733
## [1.1.0](https://github.com/clarkedb/grift/releases/tag/v1.1.0) - 2022-02-03
2834

2935
This version adds support for Ruby 3.1 and updates various dependencies.
3036

3137
### Added
3238

33-
* Support Ruby 3.1
39+
* Support Ruby 3.1 ([#52](https://github.com/clarkedb/grift/pull/52))
3440

3541
## [1.0.2](https://github.com/clarkedb/grift/releases/tag/v1.0.2) - 2021-11-11
3642

3743
This version fixes a bug that prevented the mocking of methods defined by a class's super class.
3844

3945
### Fixed
4046

41-
* Allow mocks of inherited methods
47+
* Allow mocks of inherited methods ([#34](https://github.com/clarkedb/grift/pull/34))
4248

4349
## [1.0.1](https://github.com/clarkedb/grift/releases/tag/v1.0.1) - 2021-11-10
4450

4551
This version fixes a bug that prevented most mocking features in Grift from functioning as expected.
4652

4753
### Fixed
4854

49-
* Uses relative path for yaml config files
50-
51-
### Updated
52-
53-
* Updates `rubocop-performance`
54-
* Updates `rake`
55+
* Uses relative path for yaml config files ([#28](https://github.com/clarkedb/grift/pull/28))
5556

5657
## [1.0.0](https://github.com/clarkedb/grift/releases/tag/v1.0.0) - 2021-11-06
5758

5859
The first major version of Grift! 100% documentation and 100% code coverage.
5960

6061
### Added
6162

62-
* Spying on method
63-
* Mocking method return values
64-
* Mocking method implementation
65-
* Restricted methods that cannot be mocked
66-
* MiniTest Plugin to use hooks and clean up after tests
67-
* Documentation!
63+
* Spying on method ([#9](https://github.com/clarkedb/grift/pull/9))
64+
* Mocking method return values ([#9](https://github.com/clarkedb/grift/pull/9))
65+
* Mocking method implementation ([#13](https://github.com/clarkedb/grift/pull/13))
66+
* Restricted methods that cannot be mocked ([#20](https://github.com/clarkedb/grift/pull/20))
67+
* MiniTest Plugin to use hooks and clean up after tests ([#17](https://github.com/clarkedb/grift/pull/17))
68+
* Documentation! ([#23](https://github.com/clarkedb/grift/pull/23))
6869

6970
## [0.1.0](https://github.com/clarkedb/grift/releases/tag/v0.1.0) - 2021-10-12
7071

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
grift (1.1.0)
4+
grift (2.0.0)
55

66
GEM
77
remote: https://rubygems.org/

docs/Grift.html

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<dl>
8080
<dt>Defined in:</dt>
8181
<dd>lib/grift.rb<span class="defines">,<br />
82-
lib/grift/error.rb,<br /> lib/grift/config.rb,<br /> lib/grift/version.rb,<br /> lib/grift/mock_store.rb,<br /> lib/grift/mock_method.rb,<br /> lib/grift/minitest_plugin.rb,<br /> lib/grift/mock_method/mock_executions.rb</span>
82+
lib/grift/error.rb,<br /> lib/grift/config.rb,<br /> lib/grift/version.rb,<br /> lib/grift/mock_store.rb,<br /> lib/grift/mock_method.rb,<br /> lib/grift/minitest_plugin.rb,<br /> lib/grift/mock_method/mock_executions.rb,<br /> lib/grift/mock_method/mock_executions/mock_arguments.rb</span>
8383
</dd>
8484
</dl>
8585

@@ -131,7 +131,7 @@ <h2>
131131

132132
</div>
133133
</dt>
134-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>1.1.0</span><span class='tstring_end'>&#39;</span></span></pre></dd>
134+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>2.0.0</span><span class='tstring_end'>&#39;</span></span></pre></dd>
135135

136136
</dl>
137137

@@ -485,12 +485,12 @@ <h3 class="signature first" id="mock_store-class_method">
485485
<pre class="lines">
486486

487487

488-
22
489488
23
490-
24</pre>
489+
24
490+
25</pre>
491491
</td>
492492
<td>
493-
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 22</span>
493+
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 23</span>
494494

495495
<span class='kw'>def</span> <span class='id identifier rubyid_mock_store'>mock_store</span>
496496
<span class='ivar'>@mock_store</span>
@@ -554,12 +554,12 @@ <h3 class="signature first" id="clear_all_mocks-class_method">
554554
<pre class="lines">
555555

556556

557-
135
558557
136
559-
137</pre>
558+
137
559+
138</pre>
560560
</td>
561561
<td>
562-
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 135</span>
562+
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 136</span>
563563

564564
<span class='kw'>def</span> <span class='id identifier rubyid_clear_all_mocks'>clear_all_mocks</span>
565565
<span class='ivar'>@mock_store</span><span class='period'>.</span><span class='id identifier rubyid_mocks'>mocks</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:mock_clear</span><span class='rparen'>)</span>
@@ -636,12 +636,12 @@ <h3 class="signature " id="clear_mocks-class_method">
636636
<pre class="lines">
637637

638638

639-
122
640639
123
641-
124</pre>
640+
124
641+
125</pre>
642642
</td>
643643
<td>
644-
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 122</span>
644+
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 123</span>
645645

646646
<span class='kw'>def</span> <span class='id identifier rubyid_clear_mocks'>clear_mocks</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='rparen'>)</span>
647647
<span class='ivar'>@mock_store</span><span class='period'>.</span><span class='id identifier rubyid_mocks'>mocks</span><span class='lparen'>(</span><span class='label'>klass:</span> <span class='id identifier rubyid_klass'>klass</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:mock_clear</span><span class='rparen'>)</span>
@@ -770,12 +770,12 @@ <h3 class="signature " id="mock-class_method">
770770
<pre class="lines">
771771

772772

773-
40
774773
41
775-
42</pre>
774+
42
775+
43</pre>
776776
</td>
777777
<td>
778-
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 40</span>
778+
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 41</span>
779779

780780
<span class='kw'>def</span> <span class='id identifier rubyid_mock'>mock</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='comma'>,</span> <span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='id identifier rubyid_return_value'>return_value</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
781781
<span class='id identifier rubyid_spy_on'>spy_on</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='comma'>,</span> <span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_mock_return_value'>mock_return_value</span><span class='lparen'>(</span><span class='id identifier rubyid_return_value'>return_value</span><span class='rparen'>)</span>
@@ -879,13 +879,13 @@ <h3 class="signature " id="mock_method?-class_method">
879879
<pre class="lines">
880880

881881

882-
79
883882
80
884883
81
885-
82</pre>
884+
82
885+
83</pre>
886886
</td>
887887
<td>
888-
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 79</span>
888+
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 80</span>
889889

890890
<span class='kw'>def</span> <span class='id identifier rubyid_mock_method?'>mock_method?</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='comma'>,</span> <span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span>
891891
<span class='id identifier rubyid_hash_key'>hash_key</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="Grift (module)">Grift</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Grift/MockMethod.html" title="Grift::MockMethod (class)">MockMethod</a></span></span><span class='period'>.</span><span class='id identifier rubyid_hash_key'><span class='object_link'><a href="Grift/MockMethod.html#hash_key-class_method" title="Grift::MockMethod.hash_key (method)">hash_key</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='comma'>,</span> <span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span>
@@ -943,12 +943,12 @@ <h3 class="signature " id="reset_all_mocks-class_method">
943943
<pre class="lines">
944944

945945

946-
163
947946
164
948-
165</pre>
947+
165
948+
166</pre>
949949
</td>
950950
<td>
951-
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 163</span>
951+
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 164</span>
952952

953953
<span class='kw'>def</span> <span class='id identifier rubyid_reset_all_mocks'>reset_all_mocks</span>
954954
<span class='ivar'>@mock_store</span><span class='period'>.</span><span class='id identifier rubyid_mocks'>mocks</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:mock_reset</span><span class='rparen'>)</span>
@@ -1025,12 +1025,12 @@ <h3 class="signature " id="reset_mocks-class_method">
10251025
<pre class="lines">
10261026

10271027

1028-
150
10291028
151
1030-
152</pre>
1029+
152
1030+
153</pre>
10311031
</td>
10321032
<td>
1033-
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 150</span>
1033+
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 151</span>
10341034

10351035
<span class='kw'>def</span> <span class='id identifier rubyid_reset_mocks'>reset_mocks</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='rparen'>)</span>
10361036
<span class='ivar'>@mock_store</span><span class='period'>.</span><span class='id identifier rubyid_mocks'>mocks</span><span class='lparen'>(</span><span class='label'>klass:</span> <span class='id identifier rubyid_klass'>klass</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:mock_reset</span><span class='rparen'>)</span>
@@ -1114,16 +1114,16 @@ <h3 class="signature " id="restore_all_mocks-class_method">
11141114
<pre class="lines">
11151115

11161116

1117-
206
11181117
207
11191118
208
11201119
209
11211120
210
11221121
211
1123-
212</pre>
1122+
212
1123+
213</pre>
11241124
</td>
11251125
<td>
1126-
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 206</span>
1126+
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 207</span>
11271127

11281128
<span class='kw'>def</span> <span class='id identifier rubyid_restore_all_mocks'>restore_all_mocks</span><span class='lparen'>(</span><span class='label'>watch:</span> <span class='kw'>false</span><span class='rparen'>)</span>
11291129
<span class='kw'>if</span> <span class='id identifier rubyid_watch'>watch</span>
@@ -1227,16 +1227,16 @@ <h3 class="signature " id="restore_mocks-class_method">
12271227
<pre class="lines">
12281228

12291229

1230-
183
12311230
184
12321231
185
12331232
186
12341233
187
12351234
188
1236-
189</pre>
1235+
189
1236+
190</pre>
12371237
</td>
12381238
<td>
1239-
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 183</span>
1239+
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 184</span>
12401240

12411241
<span class='kw'>def</span> <span class='id identifier rubyid_restore_mocks'>restore_mocks</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='comma'>,</span> <span class='label'>watch:</span> <span class='kw'>false</span><span class='rparen'>)</span>
12421242
<span class='kw'>if</span> <span class='id identifier rubyid_watch'>watch</span>
@@ -1350,16 +1350,16 @@ <h3 class="signature " id="restricted_method?-class_method">
13501350
<pre class="lines">
13511351

13521352

1353-
103
13541353
104
13551354
105
13561355
106
13571356
107
13581357
108
1359-
109</pre>
1358+
109
1359+
110</pre>
13601360
</td>
13611361
<td>
1362-
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 103</span>
1362+
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 104</span>
13631363

13641364
<span class='kw'>def</span> <span class='id identifier rubyid_restricted_method?'>restricted_method?</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='comma'>,</span> <span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span>
13651365
<span class='id identifier rubyid_base_klass'>base_klass</span> <span class='op'>=</span> <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>::</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
@@ -1474,12 +1474,12 @@ <h3 class="signature " id="spy_on-class_method">
14741474
<pre class="lines">
14751475

14761476

1477-
58
14781477
59
1479-
60</pre>
1478+
60
1479+
61</pre>
14801480
</td>
14811481
<td>
1482-
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 58</span>
1482+
<pre class="code"><span class="info file"># File 'lib/grift.rb', line 59</span>
14831483

14841484
<span class='kw'>def</span> <span class='id identifier rubyid_spy_on'>spy_on</span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='comma'>,</span> <span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span>
14851485
<span class='const'><span class='object_link'><a href="Grift/MockMethod.html" title="Grift::MockMethod (class)">MockMethod</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Grift/MockMethod.html#initialize-instance_method" title="Grift::MockMethod#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_klass'>klass</span><span class='comma'>,</span> <span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span>
@@ -1494,9 +1494,9 @@ <h3 class="signature " id="spy_on-class_method">
14941494
</div>
14951495

14961496
<div id="footer">
1497-
Generated on Thu Feb 3 20:35:19 2022 by
1497+
Generated on Mon Mar 14 21:41:20 2022 by
14981498
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1499-
0.9.27 (ruby-3.1.0).
1499+
0.9.27 (ruby-2.7.5).
15001500
</div>
15011501

15021502
</div>

docs/Grift/Config.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ <h3 class="signature first" id="restricted_methods-class_method">
215215
</div>
216216

217217
<div id="footer">
218-
Generated on Thu Feb 3 20:35:19 2022 by
218+
Generated on Mon Mar 14 21:41:20 2022 by
219219
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
220-
0.9.27 (ruby-3.1.0).
220+
0.9.27 (ruby-2.7.5).
221221
</div>
222222

223223
</div>

docs/Grift/Error.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ <h2>Overview</h2><div class="docstring">
125125
</div>
126126

127127
<div id="footer">
128-
Generated on Thu Feb 3 20:35:19 2022 by
128+
Generated on Mon Mar 14 21:41:20 2022 by
129129
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
130-
0.9.27 (ruby-3.1.0).
130+
0.9.27 (ruby-2.7.5).
131131
</div>
132132

133133
</div>

docs/Grift/MinitestPlugin.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ <h3 class="signature first" id="after_teardown-instance_method">
210210
</div>
211211

212212
<div id="footer">
213-
Generated on Thu Feb 3 20:35:19 2022 by
213+
Generated on Mon Mar 14 21:41:20 2022 by
214214
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
215-
0.9.27 (ruby-3.1.0).
215+
0.9.27 (ruby-2.7.5).
216216
</div>
217217

218218
</div>

0 commit comments

Comments
 (0)