@@ -110,9 +110,7 @@ def read_cache(cache_file)
110
110
111
111
context 'within date' do
112
112
let ( :cache_file_name ) { '.within_date.log' }
113
-
114
113
it 'does not write file if timestamp is within date' do
115
-
116
114
expect_any_instance_of ( HTMLProofer ::Cache ) . to receive ( :write )
117
115
118
116
# we expect no add...
@@ -122,15 +120,12 @@ def read_cache(cache_file)
122
120
expect_any_instance_of ( HTMLProofer ::Cache ) . to receive ( :within_timeframe? ) . and_return ( within )
123
121
124
122
run_proofer ( [ 'www.github.com' ] , :links , cache : { timeframe : '30d' , cache_file : cache_file_name } . merge ( default_cache_options ) )
125
-
126
123
end
127
124
end
128
125
129
126
context 'not within date' do
130
127
let ( :cache_file_name ) { '.not_within_date.log' }
131
-
132
128
it 'does write file if timestamp is not within date' do
133
-
134
129
# mock within_timeframe
135
130
expect_any_instance_of ( HTMLProofer ::Cache ) . to receive ( :write )
136
131
@@ -141,13 +136,11 @@ def read_cache(cache_file)
141
136
expect_any_instance_of ( HTMLProofer ::Cache ) . to receive ( :within_timeframe? ) . and_return ( within )
142
137
143
138
run_proofer ( [ 'www.github.com' ] , :links , cache : { timeframe : '4d' , cache_file : cache_file_name } . merge ( default_cache_options ) )
144
-
145
139
end
146
140
end
147
141
148
142
context 'new url added' do
149
143
let ( :cache_file_name ) { '.new_url.log' }
150
-
151
144
it 'does write file if a new URL is added' do
152
145
# this is frozen to within 7 days of the log
153
146
new_time = Time . local ( 2015 , 10 , 20 , 12 , 0 , 0 )
@@ -166,9 +159,7 @@ def read_cache(cache_file)
166
159
167
160
context 'recheck failure' do
168
161
let ( :cache_file_name ) { '.recheck_failure.log' }
169
-
170
162
it 'does recheck failures, regardless of cache' do
171
-
172
163
expect_any_instance_of ( HTMLProofer ::Cache ) . to receive ( :write )
173
164
174
165
# we expect the same link to be readded...
@@ -178,7 +169,6 @@ def read_cache(cache_file)
178
169
expect_any_instance_of ( HTMLProofer ::Cache ) . to receive ( :within_timeframe? ) . and_return ( within )
179
170
180
171
run_proofer ( [ 'http://www.foofoofoo.biz' ] , :links , cache : { timeframe : '30d' , cache_file : cache_file_name } . merge ( default_cache_options ) )
181
-
182
172
end
183
173
end
184
174
end
0 commit comments