File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 131
131
end
132
132
end
133
133
134
- context 'updating ' do
134
+ context 'safe update ' do
135
135
before do
136
136
x = ( 0 ..10 ) . to_a
137
137
y = x . map { |xx | Math . exp ( -xx ) }
186
186
end
187
187
188
188
it 'should update an option of existing object' do
189
- @ds . lw! ( 3 )
189
+ expect ( @ds . lw! ( 3 ) ) . to equal ( @ds )
190
190
expect ( @ds . lw ) . to eql ( 3 )
191
191
@ds . pt = 8
192
192
expect ( @ds . pt ) . to eql ( 8 )
193
193
end
194
194
195
195
it 'should update several options of existing object at once via #options!' do
196
- @ds . options! ( lw : 3 , pt : 8 )
196
+ expect ( @ds . options! ( lw : 3 , pt : 8 ) ) . to equal ( @ds )
197
197
expect ( @ds . lw ) . to eql ( 3 )
198
198
expect ( @ds . pt ) . to eql ( 8 )
199
199
end
200
200
201
201
it 'should update several options of existing object at once via #update!' do
202
- @ds . update! ( lw : 3 , pt : 8 )
202
+ expect ( @ds . update! ( lw : 3 , pt : 8 ) ) . to equal ( @ds )
203
203
expect ( @ds . lw ) . to eql ( 3 )
204
204
expect ( @ds . pt ) . to eql ( 8 )
205
205
end
211
211
x1 = ( 11 ..15 ) . to_a
212
212
y1 = x1 . map { |xx | Math . exp ( -xx ) }
213
213
@ds . plot ( options0 )
214
- @ds . update! ( [ x1 , y1 ] )
214
+ expect ( @ds . update! ( [ x1 , y1 ] ) ) . to equal ( @ds )
215
215
@ds . plot ( options1 )
216
216
expect ( same_images? ( *paths ) ) . to be_falsey
217
217
end
220
220
x1 = ( 11 ..15 ) . to_a
221
221
y1 = x1 . map { |xx | Math . exp ( -xx ) }
222
222
size_before = File . size ( @ds_file . data . to_s [ 1 ..-2 ] )
223
- @ds_file . update! ( [ x1 , y1 ] )
223
+ expect ( @ds_file . update! ( [ x1 , y1 ] ) ) . to equal ( @ds_file )
224
224
size_after = File . size ( @ds_file . data . to_s [ 1 ..-2 ] )
225
225
expect ( size_after ) . to be > size_before
226
226
end
You can’t perform that action at this time.
0 commit comments