ehbrs-tools 0.25.0 → 0.25.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.avm.yml +4 -0
- data/.rspec +1 -0
- data/.rubocop.yml +39 -0
- data/Gemfile.lock +269 -0
- data/lib/ehbrs/tools/version.rb +1 -1
- data/spec/code/rubocop_spec.rb +3 -0
- data/spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb +21 -0
- data/spec/lib/ehbrs/observers/base_spec.rb +93 -0
- data/spec/lib/ehbrs/tools/runner/fs/used_space_spec.rb +61 -0
- data/spec/lib/ehbrs/tools/runner/vg/ips_spec.rb +31 -0
- data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/expected.rom +0 -0
- data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/patch_0.ips +0 -0
- data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/patch_1.ips +0 -0
- data/spec/lib/ehbrs/tools/runner/vg/ips_spec_files/source.rom +0 -0
- data/spec/lib/ehbrs/tools/runner/videos/probe_spec.rb +19 -0
- data/spec/lib/ehbrs/tools/runner/videos/probe_spec_files/fixed.target.yaml +105 -0
- data/spec/lib/ehbrs/tools/runner/videos/unsupported_spec.rb +75 -0
- data/spec/lib/ehbrs/tools/runner/videos/unsupported_spec_files/dts_audio.probe.yaml +90 -0
- data/spec/lib/ehbrs/tools/runner_spec.rb +16 -0
- data/spec/lib/ehbrs/vg/wii/game_file_spec.rb +21 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec.rb +11 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/pikmin2_R92P01_wia.source.witdump +27 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/pikmin2_R92P01_wia.target.yaml +22 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/pikmin2_pal_iso.source.witdump +28 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/pikmin2_pal_iso.target.yaml +21 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/resident_evil_code_veronica_disc2_iso.source.witdump +16 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/resident_evil_code_veronica_disc2_iso.target.yaml +19 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/super_mario_galaxy_wbfs.source.witdump +28 -0
- data/spec/lib/ehbrs/vg/wii/wit/parsers/dump_spec_files/super_mario_galaxy_wbfs.target.yaml +23 -0
- data/spec/lib/ehbrs/vg/wii/wit/path_spec.rb +33 -0
- data/spec/spec_helper/videos.rb +30 -0
- data/spec/spec_helper/videos_files/stub_source.mp4 +0 -0
- data/spec/spec_helper.rb +7 -0
- data/vendor/ehbrs_ruby_utils/ehbrs_ruby_utils.gemspec +2 -1
- data/vendor/ehbrs_ruby_utils/lib/ehbrs_ruby_utils/version.rb +1 -1
- metadata +85 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd84e165d6c571aba1ae27995dd9a975089005db9590f6fadb5fccc9fbbc8525
|
4
|
+
data.tar.gz: 10c2d2ca5902c1e5952f56d8400a176c898f40519675dd740ecc20f9fe8f5197
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c41cea11d8cf3f1a531b84efae67be1604bc4127323280bb6da2111b546f4580fa6856d330707588d610130d0d76454990c7acf3918d769d06271ad0fe9a412
|
7
|
+
data.tar.gz: 961078668e064e54dc30c3e93c53fe82bbfe4ef8b1a7c927f63381a12e56e880ef695948c7174c9fd7889c3f2d0df7c7b25c2f4edb75a94e9968e6dd87386d87
|
data/.avm.yml
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--require spec/spec_helper --color --format doc --default-path . --pattern 'spec/**/*_spec.rb'
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rails
|
3
|
+
- rubocop-rspec
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
Exclude:
|
7
|
+
- vendor/**/*
|
8
|
+
|
9
|
+
Layout/LineLength:
|
10
|
+
Max: 100
|
11
|
+
|
12
|
+
Metrics/BlockLength:
|
13
|
+
Exclude:
|
14
|
+
- spec/**/*_spec.rb
|
15
|
+
|
16
|
+
Rails/Output:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
Rails/TimeZone:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
RSpec/NestedGroups:
|
23
|
+
Exclude:
|
24
|
+
- spec/**/*_spec.rb
|
25
|
+
|
26
|
+
Style/AsciiComments:
|
27
|
+
Enabled: false
|
28
|
+
|
29
|
+
Style/Documentation:
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
Style/HashEachMethods:
|
33
|
+
Enabled: true
|
34
|
+
|
35
|
+
Style/HashTransformKeys:
|
36
|
+
Enabled: true
|
37
|
+
|
38
|
+
Style/HashTransformValues:
|
39
|
+
Enabled: true
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,269 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
ehbrs-tools (0.25.1)
|
5
|
+
avm-tools (~> 0.82, >= 0.82.1)
|
6
|
+
eac_cli (~> 0.12, >= 0.12.5)
|
7
|
+
eac_ruby_utils (~> 0.71)
|
8
|
+
ehbrs_ruby_utils (~> 0.8.1, ~> 0.8)
|
9
|
+
filesize
|
10
|
+
inifile (~> 3.0)
|
11
|
+
os
|
12
|
+
telegram-bot-ruby
|
13
|
+
|
14
|
+
PATH
|
15
|
+
remote: vendor/aranha-parsers
|
16
|
+
specs:
|
17
|
+
aranha-parsers (0.8.3)
|
18
|
+
activesupport (>= 4.0.0)
|
19
|
+
addressable (~> 2.7)
|
20
|
+
curb (~> 0.9.10)
|
21
|
+
eac_ruby_utils (~> 0.74)
|
22
|
+
httpclient (~> 2.8, >= 2.8.3)
|
23
|
+
ofx-parser (~> 1.1.0)
|
24
|
+
|
25
|
+
PATH
|
26
|
+
remote: vendor/aranha-selenium
|
27
|
+
specs:
|
28
|
+
aranha-selenium (0.2.2)
|
29
|
+
eac_ruby_utils (~> 0.70)
|
30
|
+
selenium-webdriver (~> 3.142, >= 3.142.3)
|
31
|
+
|
32
|
+
PATH
|
33
|
+
remote: vendor/eac_cli
|
34
|
+
specs:
|
35
|
+
eac_cli (0.22.2)
|
36
|
+
colorize (~> 0.8.1)
|
37
|
+
eac_config (~> 0.5, >= 0.5.1)
|
38
|
+
eac_ruby_utils (~> 0.70)
|
39
|
+
|
40
|
+
PATH
|
41
|
+
remote: vendor/eac_config
|
42
|
+
specs:
|
43
|
+
eac_config (0.5.1)
|
44
|
+
addressable
|
45
|
+
eac_ruby_utils (~> 0.70)
|
46
|
+
|
47
|
+
PATH
|
48
|
+
remote: vendor/eac_docker
|
49
|
+
specs:
|
50
|
+
eac_docker (0.4.1)
|
51
|
+
eac_ruby_utils (~> 0.74)
|
52
|
+
eac_templates (~> 0.1)
|
53
|
+
|
54
|
+
PATH
|
55
|
+
remote: vendor/eac_ruby_base0
|
56
|
+
specs:
|
57
|
+
eac_ruby_base0 (0.10.1)
|
58
|
+
eac_cli (~> 0.22, >= 0.22.2)
|
59
|
+
eac_ruby_gems_utils (~> 0.9.5, ~> 0.9)
|
60
|
+
eac_ruby_utils (~> 0.70)
|
61
|
+
|
62
|
+
PATH
|
63
|
+
remote: vendor/eac_ruby_utils
|
64
|
+
specs:
|
65
|
+
eac_ruby_utils (0.74.0)
|
66
|
+
activesupport (>= 4.0)
|
67
|
+
addressable (~> 2.6)
|
68
|
+
filesize
|
69
|
+
net-ssh (~> 4.2)
|
70
|
+
|
71
|
+
PATH
|
72
|
+
remote: vendor/ehbrs_ruby_utils
|
73
|
+
specs:
|
74
|
+
ehbrs_ruby_utils (0.8.1)
|
75
|
+
eac_ruby_utils (~> 0.70)
|
76
|
+
eac_templates (~> 0.1, >= 0.1.1)
|
77
|
+
|
78
|
+
GEM
|
79
|
+
remote: https://rubygems.org/
|
80
|
+
specs:
|
81
|
+
activesupport (6.1.4.1)
|
82
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
83
|
+
i18n (>= 1.6, < 2)
|
84
|
+
minitest (>= 5.1)
|
85
|
+
tzinfo (~> 2.0)
|
86
|
+
zeitwerk (~> 2.3)
|
87
|
+
addressable (2.8.0)
|
88
|
+
public_suffix (>= 2.0.2, < 5.0)
|
89
|
+
asciidoctor (2.0.16)
|
90
|
+
ast (2.4.2)
|
91
|
+
avm (0.3.0)
|
92
|
+
eac_docker (~> 0.3)
|
93
|
+
eac_git (~> 0.6)
|
94
|
+
eac_ruby_utils (~> 0.68)
|
95
|
+
eac_templates (~> 0.1, >= 0.1.1)
|
96
|
+
avm-apps (0.4.0)
|
97
|
+
eac_ruby_utils (~> 0.67)
|
98
|
+
avm-eac_asciidoctor_base0 (0.3.0)
|
99
|
+
asciidoctor (~> 2.0, >= 2.0.12)
|
100
|
+
avm-eac_webapp_base0 (~> 0.1)
|
101
|
+
eac_ruby_utils (~> 0.63)
|
102
|
+
os
|
103
|
+
rouge (~> 3.26)
|
104
|
+
avm-eac_webapp_base0 (0.1.0)
|
105
|
+
avm (~> 0.1)
|
106
|
+
eac_ruby_utils (~> 0.68)
|
107
|
+
avm-tools (0.104.0)
|
108
|
+
aranha-parsers (~> 0.4)
|
109
|
+
asciidoctor (~> 2.0, >= 2.0.12)
|
110
|
+
avm (~> 0.1)
|
111
|
+
avm-apps (~> 0.2)
|
112
|
+
avm-eac_asciidoctor_base0
|
113
|
+
clipboard (~> 1.3, >= 1.3.3)
|
114
|
+
content-type (~> 0.0.1)
|
115
|
+
curb (~> 0.9.10)
|
116
|
+
eac_docker (~> 0.2)
|
117
|
+
eac_git (~> 0.2)
|
118
|
+
eac_ruby_base0 (~> 0.7, >= 0.7.2)
|
119
|
+
eac_ruby_gems_utils (~> 0.6, >= 0.6.1)
|
120
|
+
eac_templates (~> 0.1)
|
121
|
+
filesize
|
122
|
+
git (~> 1.7)
|
123
|
+
htmlbeautifier (~> 1.3, >= 1.3.1)
|
124
|
+
minitar
|
125
|
+
os
|
126
|
+
ruby-progressbar (~> 1.10, >= 1.10.1)
|
127
|
+
axiom-types (0.1.1)
|
128
|
+
descendants_tracker (~> 0.0.4)
|
129
|
+
ice_nine (~> 0.11.0)
|
130
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
131
|
+
childprocess (3.0.0)
|
132
|
+
clipboard (1.3.6)
|
133
|
+
coercible (1.0.0)
|
134
|
+
descendants_tracker (~> 0.0.1)
|
135
|
+
colorize (0.8.1)
|
136
|
+
concurrent-ruby (1.1.9)
|
137
|
+
content-type (0.0.1)
|
138
|
+
parslet (~> 1.5)
|
139
|
+
curb (0.9.11)
|
140
|
+
descendants_tracker (0.0.4)
|
141
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
142
|
+
diff-lcs (1.4.4)
|
143
|
+
dry-inflector (0.2.1)
|
144
|
+
eac_git (0.7.3)
|
145
|
+
eac_ruby_utils (~> 0.74)
|
146
|
+
parseconfig (~> 1.0, >= 1.0.8)
|
147
|
+
eac_ruby_gem_support (0.4.0)
|
148
|
+
eac_ruby_utils (~> 0.74)
|
149
|
+
rspec (~> 3.9)
|
150
|
+
rubocop (~> 0.80.1)
|
151
|
+
rubocop-rails (~> 2.4.2)
|
152
|
+
rubocop-rspec (~> 1.38.1)
|
153
|
+
eac_ruby_gems_utils (0.9.5)
|
154
|
+
bundler (~> 2.2, >= 2.2.17)
|
155
|
+
eac_ruby_utils (~> 0.70)
|
156
|
+
eac_templates (0.1.1)
|
157
|
+
eac_config (~> 0.5)
|
158
|
+
eac_ruby_utils (~> 0.64)
|
159
|
+
faraday (1.7.0)
|
160
|
+
faraday-em_http (~> 1.0)
|
161
|
+
faraday-em_synchrony (~> 1.0)
|
162
|
+
faraday-excon (~> 1.1)
|
163
|
+
faraday-httpclient (~> 1.0.1)
|
164
|
+
faraday-net_http (~> 1.0)
|
165
|
+
faraday-net_http_persistent (~> 1.1)
|
166
|
+
faraday-patron (~> 1.0)
|
167
|
+
faraday-rack (~> 1.0)
|
168
|
+
multipart-post (>= 1.2, < 3)
|
169
|
+
ruby2_keywords (>= 0.0.4)
|
170
|
+
faraday-em_http (1.0.0)
|
171
|
+
faraday-em_synchrony (1.0.0)
|
172
|
+
faraday-excon (1.1.0)
|
173
|
+
faraday-httpclient (1.0.1)
|
174
|
+
faraday-net_http (1.0.1)
|
175
|
+
faraday-net_http_persistent (1.2.0)
|
176
|
+
faraday-patron (1.0.0)
|
177
|
+
faraday-rack (1.0.0)
|
178
|
+
filesize (0.2.0)
|
179
|
+
git (1.9.1)
|
180
|
+
rchardet (~> 1.8)
|
181
|
+
hpricot (0.8.6)
|
182
|
+
htmlbeautifier (1.3.1)
|
183
|
+
httpclient (2.8.3)
|
184
|
+
i18n (1.8.10)
|
185
|
+
concurrent-ruby (~> 1.0)
|
186
|
+
ice_nine (0.11.2)
|
187
|
+
inifile (3.0.0)
|
188
|
+
jaro_winkler (1.5.4)
|
189
|
+
minitar (0.9)
|
190
|
+
minitest (5.14.4)
|
191
|
+
multipart-post (2.1.1)
|
192
|
+
net-ssh (4.2.0)
|
193
|
+
ofx-parser (1.1.0)
|
194
|
+
hpricot (>= 0.6)
|
195
|
+
os (1.1.1)
|
196
|
+
parallel (1.20.1)
|
197
|
+
parseconfig (1.1.0)
|
198
|
+
parser (3.0.2.0)
|
199
|
+
ast (~> 2.4.1)
|
200
|
+
parslet (1.8.2)
|
201
|
+
public_suffix (4.0.6)
|
202
|
+
rack (2.2.3)
|
203
|
+
rainbow (3.0.0)
|
204
|
+
rchardet (1.8.0)
|
205
|
+
rexml (3.2.5)
|
206
|
+
rouge (3.26.0)
|
207
|
+
rspec (3.10.0)
|
208
|
+
rspec-core (~> 3.10.0)
|
209
|
+
rspec-expectations (~> 3.10.0)
|
210
|
+
rspec-mocks (~> 3.10.0)
|
211
|
+
rspec-core (3.10.1)
|
212
|
+
rspec-support (~> 3.10.0)
|
213
|
+
rspec-expectations (3.10.1)
|
214
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
215
|
+
rspec-support (~> 3.10.0)
|
216
|
+
rspec-mocks (3.10.2)
|
217
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
218
|
+
rspec-support (~> 3.10.0)
|
219
|
+
rspec-support (3.10.2)
|
220
|
+
rubocop (0.80.1)
|
221
|
+
jaro_winkler (~> 1.5.1)
|
222
|
+
parallel (~> 1.10)
|
223
|
+
parser (>= 2.7.0.1)
|
224
|
+
rainbow (>= 2.2.2, < 4.0)
|
225
|
+
rexml
|
226
|
+
ruby-progressbar (~> 1.7)
|
227
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
228
|
+
rubocop-rails (2.4.2)
|
229
|
+
rack (>= 1.1)
|
230
|
+
rubocop (>= 0.72.0)
|
231
|
+
rubocop-rspec (1.38.1)
|
232
|
+
rubocop (>= 0.68.1)
|
233
|
+
ruby-progressbar (1.11.0)
|
234
|
+
ruby2_keywords (0.0.5)
|
235
|
+
rubyzip (2.3.2)
|
236
|
+
selenium-webdriver (3.142.7)
|
237
|
+
childprocess (>= 0.5, < 4.0)
|
238
|
+
rubyzip (>= 1.2.2)
|
239
|
+
telegram-bot-ruby (0.16.0)
|
240
|
+
dry-inflector
|
241
|
+
faraday
|
242
|
+
virtus (~> 2.0)
|
243
|
+
thread_safe (0.3.6)
|
244
|
+
tzinfo (2.0.4)
|
245
|
+
concurrent-ruby (~> 1.0)
|
246
|
+
unicode-display_width (1.6.1)
|
247
|
+
virtus (2.0.0)
|
248
|
+
axiom-types (~> 0.1)
|
249
|
+
coercible (~> 1.0)
|
250
|
+
descendants_tracker (~> 0.0, >= 0.0.3)
|
251
|
+
zeitwerk (2.4.2)
|
252
|
+
|
253
|
+
PLATFORMS
|
254
|
+
x86_64-linux
|
255
|
+
|
256
|
+
DEPENDENCIES
|
257
|
+
aranha-parsers!
|
258
|
+
aranha-selenium!
|
259
|
+
eac_cli!
|
260
|
+
eac_config!
|
261
|
+
eac_docker!
|
262
|
+
eac_ruby_base0!
|
263
|
+
eac_ruby_gem_support (~> 0.3)
|
264
|
+
eac_ruby_utils!
|
265
|
+
ehbrs-tools!
|
266
|
+
ehbrs_ruby_utils!
|
267
|
+
|
268
|
+
BUNDLED WITH
|
269
|
+
2.2.25
|
data/lib/ehbrs/tools/version.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ehbrs/cooking_book/recipe/measure'
|
4
|
+
|
5
|
+
RSpec.describe ::Ehbrs::CookingBook::Recipe::Measure do
|
6
|
+
describe '#build'
|
7
|
+
{
|
8
|
+
'1.5 cup' => [1.5, nil, 'cup'],
|
9
|
+
'~' => [nil, nil, nil],
|
10
|
+
'2/ 3 u' => [2, 3, 'u'],
|
11
|
+
'4.5/7.8' => [4.5, 7.8, nil]
|
12
|
+
}.each do |source, expected|
|
13
|
+
context "when source is \"#{source}\"" do
|
14
|
+
let(:instance) { described_class.build(source) }
|
15
|
+
|
16
|
+
it { expect(instance.numerator).to eq(expected[0]) }
|
17
|
+
it { expect(instance.denominator).to eq(expected[1]) }
|
18
|
+
it { expect(instance.unit).to eq(expected[2]) }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ehbrs/observers/base'
|
4
|
+
|
5
|
+
RSpec.describe ::Ehbrs::Observers::Base do
|
6
|
+
let(:instance) { described_class.new }
|
7
|
+
let(:first_value) { 'a value' }
|
8
|
+
let(:same_value) { first_value.dup }
|
9
|
+
let(:different_value) { 'another value' }
|
10
|
+
let(:first_time) { ::Time.required_zone.local(2020, 5, 1, 12, 45, 0) }
|
11
|
+
let(:second_time) { ::Time.required_zone.local(2020, 5, 1, 12, 45, 0) }
|
12
|
+
|
13
|
+
it { expect(instance.records.count).to be_zero }
|
14
|
+
it { expect(instance.last_change_time).to be_blank }
|
15
|
+
it { expect(instance.last_check_time).to be_blank }
|
16
|
+
|
17
|
+
it { expect(instance).to be_changing_value(nil) }
|
18
|
+
it { expect(instance).to be_changing_value(first_value) }
|
19
|
+
it { expect(instance).to be_changing_value(same_value) }
|
20
|
+
it { expect(instance).to be_changing_value(different_value) }
|
21
|
+
|
22
|
+
context 'when firstly checked' do
|
23
|
+
before { instance.check(first_value, first_time) }
|
24
|
+
|
25
|
+
it { expect(instance.records.count).to eq(1) }
|
26
|
+
it { expect(instance.last_value).to eq(first_value) }
|
27
|
+
it { expect(instance).not_to be_changing_value(same_value) }
|
28
|
+
it { expect(instance).to be_changing_value(different_value) }
|
29
|
+
it { expect(instance.last_change_time).to eq(first_time) }
|
30
|
+
it { expect(instance.last_check_time).to eq(first_time) }
|
31
|
+
|
32
|
+
context 'when same first_value is checked' do
|
33
|
+
before { instance.check(same_value, second_time) }
|
34
|
+
|
35
|
+
it { expect(instance.records.count).to eq(1) }
|
36
|
+
it { expect(instance.last_value).to eq(same_value) }
|
37
|
+
it { expect(instance.last_change_time).to eq(first_time) }
|
38
|
+
it { expect(instance.last_check_time).to eq(second_time) }
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'when different first_value is checked' do
|
42
|
+
before { instance.check(different_value, second_time) }
|
43
|
+
|
44
|
+
it { expect(instance.records.count).to eq(2) }
|
45
|
+
it { expect(instance.last_value).to eq(different_value) }
|
46
|
+
it { expect(instance.last_change_time).to eq(second_time) }
|
47
|
+
it { expect(instance.last_check_time).to eq(second_time) }
|
48
|
+
end
|
49
|
+
|
50
|
+
context 'when checked first_value is blank' do
|
51
|
+
context 'when blank_value == :add' do
|
52
|
+
let(:instance) { described_class.new(blank_value: :add) }
|
53
|
+
|
54
|
+
before { instance.check(nil, second_time) }
|
55
|
+
|
56
|
+
it { expect(instance.records.count).to eq(2) }
|
57
|
+
it { expect(instance.last_value).to eq(nil) }
|
58
|
+
it { expect(instance.last_change_time).to eq(second_time) }
|
59
|
+
it { expect(instance.last_check_time).to eq(second_time) }
|
60
|
+
end
|
61
|
+
|
62
|
+
context 'when blank_value == :ignore' do
|
63
|
+
let(:instance) { described_class.new(blank_value: :ignore) }
|
64
|
+
|
65
|
+
before { instance.check(nil, second_time) }
|
66
|
+
|
67
|
+
it { expect(instance.records.count).to eq(1) }
|
68
|
+
it { expect(instance.last_value).to eq(first_value) }
|
69
|
+
it { expect(instance.last_change_time).to eq(first_time) }
|
70
|
+
it { expect(instance.last_check_time).to eq(second_time) }
|
71
|
+
end
|
72
|
+
|
73
|
+
context 'when blank_value == :raise' do
|
74
|
+
let(:instance) { described_class.new(blank_value: :raise) }
|
75
|
+
|
76
|
+
before do
|
77
|
+
@exception = nil
|
78
|
+
begin
|
79
|
+
instance.check(nil, second_time)
|
80
|
+
rescue StandardError => e
|
81
|
+
@exception = e
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
it { expect(@exception).to be_a(::ArgumentError) } # rubocop:disable RSpec/InstanceVariable
|
86
|
+
it { expect(instance.records.count).to eq(1) }
|
87
|
+
it { expect(instance.last_value).to eq(first_value) }
|
88
|
+
it { expect(instance.last_change_time).to eq(first_time) }
|
89
|
+
it { expect(instance.last_check_time).to eq(second_time) }
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|