nmatrix 0.1.0.rc1 → 0.1.0.rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,9 +55,9 @@ describe "NMatrix enumeration for" do
55
55
  end
56
56
  end
57
57
 
58
- vv.should == [7,8,9, 12,13,0, 0,0,0, 0,17,18]
59
- ii.should == [0]*12
60
- jj.should == [0,1,2]*4
58
+ expect(vv).to eq([7,8,9, 12,13,0, 0,0,0, 0,17,18])
59
+ expect(ii).to eq([0]*12)
60
+ expect(jj).to eq([0,1,2]*4)
61
61
  end
62
62
 
63
63
  it "should iterate along diagonal portion of A array" do
@@ -69,9 +69,9 @@ describe "NMatrix enumeration for" do
69
69
  ii << i
70
70
  jj << j
71
71
  end
72
- vv.should == [1,7,13,0,19]
73
- ii.should == [0,1,2,3,4]
74
- jj.should == ii
72
+ expect(vv).to eq([1,7,13,0,19])
73
+ expect(ii).to eq([0,1,2,3,4])
74
+ expect(jj).to eq(ii)
75
75
  end
76
76
 
77
77
  it "should iterate along non-diagonal portion of A array" do
@@ -84,9 +84,9 @@ describe "NMatrix enumeration for" do
84
84
  jj << j
85
85
  end
86
86
 
87
- vv.should == [2,3,4,5, 6,8,9,10, 11,12,14,15, 16,17,18,20]
88
- ii.should == [[0]*4, [1]*4, [2]*4, [4]*4].flatten
89
- jj.should == [1,2,3,4, 0,2,3,5, 0,1,4,5, 0,2,3,5]
87
+ expect(vv).to eq([2,3,4,5, 6,8,9,10, 11,12,14,15, 16,17,18,20])
88
+ expect(ii).to eq([[0]*4, [1]*4, [2]*4, [4]*4].flatten)
89
+ expect(jj).to eq([1,2,3,4, 0,2,3,5, 0,1,4,5, 0,2,3,5])
90
90
  end
91
91
 
92
92
  it "should iterate along a sliced diagonal portion of an A array" do
@@ -99,9 +99,9 @@ describe "NMatrix enumeration for" do
99
99
  ii << i
100
100
  jj << j
101
101
  end
102
- vv.should == [7,13,0]
103
- ii.should == [1,2,3]
104
- jj.should == [0,1,2]
102
+ expect(vv).to eq([7,13,0])
103
+ expect(ii).to eq([1,2,3])
104
+ expect(jj).to eq([0,1,2])
105
105
  end
106
106
 
107
107
  it "should iterate along a sliced non-diagonal portion of a sliced A array" do
@@ -116,9 +116,9 @@ describe "NMatrix enumeration for" do
116
116
  jj << j
117
117
  end
118
118
 
119
- ii.should == [0,0, 1, 3,3 ]
120
- jj.should == [1,2, 0, 1,2 ]
121
- vv.should == [8,9, 12, 17,18]
119
+ expect(ii).to eq([0,0, 1, 3,3 ])
120
+ expect(jj).to eq([1,2, 0, 1,2 ])
121
+ expect(vv).to eq([8,9, 12, 17,18])
122
122
  end
123
123
 
124
124
  it "should visit each stored element of the matrix in order by indices" do
@@ -131,9 +131,9 @@ describe "NMatrix enumeration for" do
131
131
  jj << j
132
132
  end
133
133
 
134
- vv.should == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 16, 17, 18, 19, 20]
135
- ii.should == [[0]*5, [1]*5, [2]*5, [3]*1, [4]*5].flatten
136
- jj.should == [0,1,2,3,4, 0,1,2,3,5, 0,1,2,4,5, 3, 0,2,3,4,5]
134
+ expect(vv).to eq([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 16, 17, 18, 19, 20])
135
+ expect(ii).to eq([[0]*5, [1]*5, [2]*5, [3]*1, [4]*5].flatten)
136
+ expect(jj).to eq([0,1,2,3,4, 0,1,2,3,5, 0,1,2,4,5, 3, 0,2,3,4,5])
137
137
  end
138
138
 
139
139
  it "should visit each stored element of the slice in order by indices" do
@@ -146,9 +146,9 @@ describe "NMatrix enumeration for" do
146
146
  ii << i
147
147
  jj << j
148
148
  end
149
- ii.should == [0,0,0, 1,1, 2, 3,3 ]
150
- jj.should == [0,1,2, 0,1, 2, 1,2 ]
151
- vv.should == [7,8,9, 12,13, 0, 17,18 ]
149
+ expect(ii).to eq([0,0,0, 1,1, 2, 3,3 ])
150
+ expect(jj).to eq([0,1,2, 0,1, 2, 1,2 ])
151
+ expect(vv).to eq([7,8,9, 12,13, 0, 17,18 ])
152
152
  end
153
153
  end
154
154
 
@@ -162,9 +162,9 @@ describe "NMatrix enumeration for" do
162
162
  jj << j
163
163
  end
164
164
 
165
- vv.should == [1,2,3,4,5,0,6,7,8,9,0,10,11,12,13,0,14,15,0,0,0,0,0,0,16,0,17,18,19,20]
166
- ii.should == [[0]*6, [1]*6, [2]*6, [3]*6, [4]*6].flatten
167
- jj.should == [0,1,2,3,4,5]*5
165
+ expect(vv).to eq([1,2,3,4,5,0,6,7,8,9,0,10,11,12,13,0,14,15,0,0,0,0,0,0,16,0,17,18,19,20])
166
+ expect(ii).to eq([[0]*6, [1]*6, [2]*6, [3]*6, [4]*6].flatten)
167
+ expect(jj).to eq([0,1,2,3,4,5]*5)
168
168
  end
169
169
 
170
170
  it "should visit each cell in the slice as if dense, making indices available" do
@@ -176,21 +176,21 @@ describe "NMatrix enumeration for" do
176
176
  ii << i
177
177
  jj << j
178
178
  end
179
- jj.should == [0,1,2]*4
180
- ii.should == [[0]*3, [1]*3, [2]*3, [3]*3].flatten
181
- vv.should == [7,8,9,12,13,0,0,0,0,0,17,18]
179
+ expect(jj).to eq([0,1,2]*4)
180
+ expect(ii).to eq([[0]*3, [1]*3, [2]*3, [3]*3].flatten)
181
+ expect(vv).to eq([7,8,9,12,13,0,0,0,0,0,17,18])
182
182
 
183
183
  end
184
184
 
185
185
  if stype == :list or stype == :dense then
186
186
  it "should correctly map to a matrix with a single element" do
187
187
  nm = N.new([1], [2.0], stype: stype)
188
- nm.map { |e| e**2 }.should eq N.new([1], [4.0], stype: stype)
188
+ expect(nm.map { |e| e**2 }).to eq N.new([1], [4.0], stype: stype)
189
189
  end
190
190
 
191
191
  it "should correctly map to a matrix with multiple elements" do
192
192
  nm = N.new([2], [2.0, 2.0], stype: stype)
193
- nm.map { |e| e**2 }.should eq N.new([2], [4.0, 4.0], stype: stype)
193
+ expect(nm.map { |e| e**2 }).to eq N.new([2], [4.0, 4.0], stype: stype)
194
194
  end
195
195
  end
196
196
  end
@@ -45,8 +45,8 @@ describe "Slice operation" do
45
45
  it "should correctly return a row of a reference-slice" do
46
46
  @n = create_rectangular_matrix(stype)
47
47
  @m = @n[1..4,1..3]
48
- @m.row(1, :copy).should == @m.row(1, :reference)
49
- @m.row(1, :copy).to_flat_array.should == [12,13,0]
48
+ expect(@m.row(1, :copy)).to eq(@m.row(1, :reference))
49
+ expect(@m.row(1, :copy).to_flat_array).to eq([12,13,0])
50
50
  end
51
51
 
52
52
  if stype == :yale
@@ -69,9 +69,9 @@ describe "Slice operation" do
69
69
  js << j
70
70
  end
71
71
 
72
- vs.should == [3,4,5,6,7]
73
- js.should == [2,3,5,7,8]
74
- is.should == [0,0,0,0,0]
72
+ expect(vs).to eq([3,4,5,6,7])
73
+ expect(js).to eq([2,3,5,7,8])
74
+ expect(is).to eq([0,0,0,0,0])
75
75
  end
76
76
  elsif stype == :list
77
77
  it "should iterate across a partial row of stored indices" do
@@ -86,9 +86,9 @@ describe "Slice operation" do
86
86
  js << j
87
87
  end
88
88
 
89
- vs.should == [7,8]
90
- is.should == [0,0]
91
- js.should == [0,1]
89
+ expect(vs).to eq([7,8])
90
+ expect(is).to eq([0,0])
91
+ expect(js).to eq([0,1])
92
92
  end
93
93
  end
94
94
 
@@ -103,9 +103,9 @@ describe "Slice operation" do
103
103
  is << i
104
104
  js << j
105
105
  end
106
- vs.should == (stype == :yale ? [8,6,7] : [6,7,8])
107
- is.should == [0,0,0]
108
- js.should == (stype == :yale ? [2,0,1] : [0,1,2])
106
+ expect(vs).to eq(stype == :yale ? [8,6,7] : [6,7,8])
107
+ expect(is).to eq([0,0,0])
108
+ expect(js).to eq(stype == :yale ? [2,0,1] : [0,1,2])
109
109
  end
110
110
 
111
111
  it "should iterate across a submatrix of stored indices" do
@@ -118,91 +118,91 @@ describe "Slice operation" do
118
118
  js << j
119
119
  end
120
120
 
121
- vs.should == (stype == :yale ? [4,1,2,5] : [1,2,4,5])
122
- is.should == (stype == :yale ? [1,0,0,1] : [0,0,1,1])
123
- js.should == (stype == :yale ? [0,0,1,1] : [0,1,0,1])
121
+ expect(vs).to eq(stype == :yale ? [4,1,2,5] : [1,2,4,5])
122
+ expect(is).to eq(stype == :yale ? [1,0,0,1] : [0,0,1,1])
123
+ expect(js).to eq(stype == :yale ? [0,0,1,1] : [0,1,0,1])
124
124
  end
125
125
  end
126
126
 
127
127
  it "should return correct supershape" do
128
128
  x = NMatrix.random([10,12])
129
129
  y = x[0...8,5...12]
130
- y.shape.should == [8,7]
131
- y.supershape.should == [10,12]
130
+ expect(y.shape).to eq([8,7])
131
+ expect(y.supershape).to eq([10,12])
132
132
  end
133
133
 
134
134
  it "should have #is_ref? method" do
135
135
  a = @m[0..1, 0..1]
136
136
  b = @m.slice(0..1, 0..1)
137
- @m.is_ref?.should be_false
138
- a.is_ref?.should be_true
139
- b.is_ref?.should be_false
137
+ expect(@m.is_ref?).to be_false
138
+ expect(a.is_ref?).to be_true
139
+ expect(b.is_ref?).to be_false
140
140
  end
141
141
 
142
142
  it "reference should compare with non-reference" do
143
- @m.slice(1..2,0..1).should == @m[1..2, 0..1]
144
- @m[1..2,0..1].should == @m.slice(1..2, 0..1)
145
- @m[1..2,0..1].should == @m[1..2, 0..1]
143
+ expect(@m.slice(1..2,0..1)).to eq(@m[1..2, 0..1])
144
+ expect(@m[1..2,0..1]).to eq(@m.slice(1..2, 0..1))
145
+ expect(@m[1..2,0..1]).to eq(@m[1..2, 0..1])
146
146
  end
147
147
 
148
148
  context "with copying" do
149
149
  it 'should return an NMatrix' do
150
150
  n = @m.slice(0..1,0..1)
151
- nm_eql(n, NMatrix.new([2,2], [0,1,3,4], dtype: :int32)).should be_true
151
+ expect(nm_eql(n, NMatrix.new([2,2], [0,1,3,4], dtype: :int32))).to be_true
152
152
  end
153
153
 
154
154
  it 'should return a copy of 2x2 matrix to self elements' do
155
155
  n = @m.slice(1..2,0..1)
156
- n.shape.should eql([2,2])
156
+ expect(n.shape).to eql([2,2])
157
157
 
158
- n[1,1].should == @m[2,1]
158
+ expect(n[1,1]).to eq(@m[2,1])
159
159
  n[1,1] = -9
160
- @m[2,1].should eql(7)
160
+ expect(@m[2,1]).to eql(7)
161
161
  end
162
162
 
163
163
  it 'should return a 1x2 matrix without refs to self elements' do
164
164
  n = @m.slice(0,1..2)
165
- n.shape.should eql([1,2])
165
+ expect(n.shape).to eql([1,2])
166
166
 
167
- n[0].should == @m[0,1]
168
- n[1].should == @m[0,2]
167
+ expect(n[0]).to eq(@m[0,1])
168
+ expect(n[1]).to eq(@m[0,2])
169
169
  n[0] = -9
170
- @m[0,1].should eql(1)
171
- @m[0,2].should eql(2)
170
+ expect(@m[0,1]).to eql(1)
171
+ expect(@m[0,2]).to eql(2)
172
172
  end
173
173
 
174
174
  it 'should return a 2x1 matrix without refs to self elements' do
175
175
  @m.extend NMatrix::YaleFunctions
176
176
 
177
177
  n = @m.slice(0..1,1)
178
- n.shape.should eql([2,1])
178
+ expect(n.shape).to eql([2,1])
179
179
 
180
- n[0].should == @m[0,1]
181
- n[1].should == @m[1,1]
180
+ expect(n[0]).to eq(@m[0,1])
181
+ expect(n[1]).to eq(@m[1,1])
182
182
  n[0] = -9
183
- @m[0,1].should eql(1)
184
- @m[1,1].should eql(4)
183
+ expect(@m[0,1]).to eql(1)
184
+ expect(@m[1,1]).to eql(4)
185
185
  end
186
186
 
187
187
  it 'should be correct slice for range 0..2 and 0...3' do
188
- @m.slice(0..2,0..2).should == @m.slice(0...3,0...3)
188
+ expect(@m.slice(0..2,0..2)).to eq(@m.slice(0...3,0...3))
189
189
  end
190
190
 
191
191
  [:dense, :list, :yale].each do |cast_type|
192
192
  it "should cast copied slice from #{stype.upcase} to #{cast_type.upcase}" do
193
- nm_eql(@m.slice(1..2, 1..2).cast(cast_type, :int32), @m.slice(1..2,1..2)).should be_true
194
- nm_eql(@m.slice(0..1, 1..2).cast(cast_type, :int32), @m.slice(0..1,1..2)).should be_true
195
- nm_eql(@m.slice(1..2, 0..1).cast(cast_type, :int32), @m.slice(1..2,0..1)).should be_true
196
- nm_eql(@m.slice(0..1, 0..1).cast(cast_type, :int32), @m.slice(0..1,0..1)).should be_true
193
+ expect(nm_eql(@m.slice(1..2, 1..2).cast(cast_type, :int32), @m.slice(1..2,1..2))).to be_true
194
+ expect(nm_eql(@m.slice(0..1, 1..2).cast(cast_type, :int32), @m.slice(0..1,1..2))).to be_true
195
+ expect(nm_eql(@m.slice(1..2, 0..1).cast(cast_type, :int32), @m.slice(1..2,0..1))).to be_true
196
+ expect(nm_eql(@m.slice(0..1, 0..1).cast(cast_type, :int32), @m.slice(0..1,0..1))).to be_true
197
197
 
198
198
  # Non square
199
- nm_eql(@m.slice(0..2, 1..2).cast(cast_type, :int32), @m.slice(0..2,1..2)).should be_true
199
+ expect(nm_eql(@m.slice(0..2, 1..2).cast(cast_type, :int32), @m.slice(0..2,1..2))).to be_true
200
200
  #require 'pry'
201
201
  #binding.pry if cast_type == :yale
202
- nm_eql(@m.slice(1..2, 0..2).cast(cast_type, :int32), @m.slice(1..2,0..2)).should be_true
202
+ expect(nm_eql(@m.slice(1..2, 0..2).cast(cast_type, :int32), @m.slice(1..2,0..2))).to be_true
203
203
 
204
204
  # Full
205
- nm_eql(@m.slice(0..2, 0..2).cast(cast_type, :int32), @m).should be_true
205
+ expect(nm_eql(@m.slice(0..2, 0..2).cast(cast_type, :int32), @m)).to be_true
206
206
  end
207
207
  end
208
208
  end
@@ -221,47 +221,47 @@ describe "Slice operation" do
221
221
  context "by reference" do
222
222
  it 'should return an NMatrix' do
223
223
  n = @m[0..1,0..1]
224
- nm_eql(n, NMatrix.new([2,2], [0,1,3,4], dtype: :int32)).should be_true
224
+ expect(nm_eql(n, NMatrix.new([2,2], [0,1,3,4], dtype: :int32))).to be_true
225
225
  end
226
226
 
227
227
  it 'should return a 2x2 matrix with refs to self elements' do
228
228
  n = @m[1..2,0..1]
229
- n.shape.should eql([2,2])
229
+ expect(n.shape).to eql([2,2])
230
230
 
231
- n[0,0].should == @m[1,0]
231
+ expect(n[0,0]).to eq(@m[1,0])
232
232
  n[0,0] = -9
233
- @m[1,0].should eql(-9)
233
+ expect(@m[1,0]).to eql(-9)
234
234
  end
235
235
 
236
236
  it 'should return a 1x2 vector with refs to self elements' do
237
237
  n = @m[0,1..2]
238
- n.shape.should eql([1,2])
238
+ expect(n.shape).to eql([1,2])
239
239
 
240
- n[0].should == @m[0,1]
240
+ expect(n[0]).to eq(@m[0,1])
241
241
  n[0] = -9
242
- @m[0,1].should eql(-9)
242
+ expect(@m[0,1]).to eql(-9)
243
243
  end
244
244
 
245
245
  it 'should return a 2x1 vector with refs to self elements' do
246
246
  n = @m[0..1,1]
247
- n.shape.should eql([2,1])
247
+ expect(n.shape).to eql([2,1])
248
248
 
249
- n[0].should == @m[0,1]
249
+ expect(n[0]).to eq(@m[0,1])
250
250
  n[0] = -9
251
- @m[0,1].should eql(-9)
251
+ expect(@m[0,1]).to eql(-9)
252
252
  end
253
253
 
254
254
  it 'should slice again' do
255
255
  n = @m[1..2, 1..2]
256
- nm_eql(n[1,0..1], NVector.new(2, [7,8], dtype: :int32).transpose).should be_true
256
+ expect(nm_eql(n[1,0..1], NVector.new(2, [7,8], dtype: :int32).transpose)).to be_true
257
257
  end
258
258
 
259
259
  it 'should be correct slice for range 0..2 and 0...3' do
260
- @m[0..2,0..2].should == @m[0...3,0...3]
260
+ expect(@m[0..2,0..2]).to eq(@m[0...3,0...3])
261
261
  end
262
262
 
263
263
  it 'should correctly handle :* slice notation' do
264
- @m[:*,0].should eq @m[0...@m.shape[0], 0]
264
+ expect(@m[:*,0]).to eq @m[0...@m.shape[0], 0]
265
265
  end
266
266
 
267
267
  if stype == :dense
@@ -297,14 +297,14 @@ describe "Slice operation" do
297
297
  m = NMatrix.new([3,2], mary, dtype: right_dtype)[1..2,0..1]
298
298
 
299
299
  r = n.dot m
300
- r.shape.should eql([3,2])
300
+ expect(r.shape).to eql([3,2])
301
301
 
302
- r[0,0].should == 219.0
303
- r[0,1].should == 185.0
304
- r[1,0].should == 244.0
305
- r[1,1].should == 205.0
306
- r[2,0].should == 42.0
307
- r[2,1].should == 35.0
302
+ expect(r[0,0]).to eq(219.0)
303
+ expect(r[0,1]).to eq(185.0)
304
+ expect(r[1,0]).to eq(244.0)
305
+ expect(r[1,1]).to eq(205.0)
306
+ expect(r[2,0]).to eq(42.0)
307
+ expect(r[2,1]).to eq(35.0)
308
308
 
309
309
  end
310
310
  end
@@ -313,37 +313,37 @@ describe "Slice operation" do
313
313
  context "operations" do
314
314
 
315
315
  it "correctly transposes slices" do
316
- @m[0...3,0].transpose.should eq NMatrix[[0, 3, 6]]
316
+ expect(@m[0...3,0].transpose).to eq NMatrix[[0, 3, 6]]
317
317
  end
318
318
 
319
319
  it "adds slices" do
320
- (NMatrix[[0,0,0]] + @m[1,0..2]).should eq NMatrix[[3, 4, 5]]
320
+ expect(NMatrix[[0,0,0]] + @m[1,0..2]).to eq NMatrix[[3, 4, 5]]
321
321
  end
322
322
 
323
323
  it "scalar adds to slices" do
324
- (@m[1,0..2]+1).should eq NMatrix[[4, 5, 6]]
324
+ expect(@m[1,0..2]+1).to eq NMatrix[[4, 5, 6]]
325
325
  end
326
326
 
327
327
  it "compares slices to scalars" do
328
- (@m[1, 0..2] > 2).each { |e| (e != 0).should be_true }
328
+ (@m[1, 0..2] > 2).each { |e| expect(e != 0).to be_true }
329
329
  end
330
330
 
331
331
  it "iterates only over elements in the slice" do
332
332
  els = []
333
333
  @m[1, 0..2].each { |e| els << e }
334
- els.size.should eq 3
335
- els[0].should eq 3
336
- els[1].should eq 4
337
- els[2].should eq 5
334
+ expect(els.size).to eq 3
335
+ expect(els[0]).to eq 3
336
+ expect(els[1]).to eq 4
337
+ expect(els[2]).to eq 5
338
338
  end
339
339
 
340
340
  it "iterates with index only over elements in the slice" do
341
341
  els = []
342
342
  @m[1, 0..2].each_stored_with_indices { |a| els << a }
343
- els.size.should eq 3
344
- els[0].should eq [3, 0, 0]
345
- els[1].should eq [4, 0, 1]
346
- els[2].should eq [5, 0, 2]
343
+ expect(els.size).to eq 3
344
+ expect(els[0]).to eq [3, 0, 0]
345
+ expect(els[1]).to eq [4, 0, 1]
346
+ expect(els[2]).to eq [5, 0, 2]
347
347
  end
348
348
 
349
349
  end
@@ -359,33 +359,33 @@ describe "Slice operation" do
359
359
  end
360
360
 
361
361
  step "reference slice of casted-copy" do
362
- @m.should == NMatrix.new([3,3], (0..9).to_a, dtype: :int32).cast(stype, :int32)
362
+ expect(@m).to eq(NMatrix.new([3,3], (0..9).to_a, dtype: :int32).cast(stype, :int32))
363
363
  n = nil
364
364
  1.times do
365
365
  m = NMatrix.new([2,2], [1,2,3,4]).cast(stype, :int32)
366
366
  n = m[0..1,0..1]
367
367
  end
368
368
  GC.start
369
- n.should == NMatrix.new([2,2], [1,2,3,4]).cast(stype, :int32)
369
+ expect(n).to eq(NMatrix.new([2,2], [1,2,3,4]).cast(stype, :int32))
370
370
  end
371
371
  end
372
372
 
373
373
  [:dense, :list, :yale].each do |cast_type|
374
374
  it "should cast a square reference-slice from #{stype.upcase} to #{cast_type.upcase}" do
375
- nm_eql(@m[1..2, 1..2].cast(cast_type), @m[1..2,1..2]).should be_true
376
- nm_eql(@m[0..1, 1..2].cast(cast_type), @m[0..1,1..2]).should be_true
377
- nm_eql(@m[1..2, 0..1].cast(cast_type), @m[1..2,0..1]).should be_true
378
- nm_eql(@m[0..1, 0..1].cast(cast_type), @m[0..1,0..1]).should be_true
375
+ expect(nm_eql(@m[1..2, 1..2].cast(cast_type), @m[1..2,1..2])).to be_true
376
+ expect(nm_eql(@m[0..1, 1..2].cast(cast_type), @m[0..1,1..2])).to be_true
377
+ expect(nm_eql(@m[1..2, 0..1].cast(cast_type), @m[1..2,0..1])).to be_true
378
+ expect(nm_eql(@m[0..1, 0..1].cast(cast_type), @m[0..1,0..1])).to be_true
379
379
  end
380
380
 
381
381
  it "should cast a rectangular reference-slice from #{stype.upcase} to #{cast_type.upcase}" do
382
382
  # Non square
383
- nm_eql(@m[0..2, 1..2].cast(cast_type), @m[0..2,1..2]).should be_true # FIXME: memory problem.
384
- nm_eql(@m[1..2, 0..2].cast(cast_type), @m[1..2,0..2]).should be_true # this one is fine
383
+ expect(nm_eql(@m[0..2, 1..2].cast(cast_type), @m[0..2,1..2])).to be_true # FIXME: memory problem.
384
+ expect(nm_eql(@m[1..2, 0..2].cast(cast_type), @m[1..2,0..2])).to be_true # this one is fine
385
385
  end
386
386
 
387
387
  it "should cast a square full-matrix reference-slice from #{stype.upcase} to #{cast_type.upcase}" do
388
- nm_eql(@m[0..2, 0..2].cast(cast_type), @m).should be_true
388
+ expect(nm_eql(@m[0..2, 0..2].cast(cast_type), @m)).to be_true
389
389
  end
390
390
  end
391
391
  end