|
27 | 27 | it 'returns a initialised Basic object that is result of |
28 | 28 | self added to the argument' do |
29 | 29 | c = @a + @b |
30 | | - expect(c).to be_an_instance_of SymEngine::Basic |
| 30 | + expect(c).to be_a SymEngine::Basic |
31 | 31 | expect(c.to_s).to eql('x + y') |
32 | 32 | end |
33 | 33 | end |
|
37 | 37 | it 'returns a initialised Basic object that is result of |
38 | 38 | argument subtracted from self' do |
39 | 39 | c = @a - @b |
40 | | - expect(c).to be_an_instance_of SymEngine::Basic |
| 40 | + expect(c).to be_a SymEngine::Basic |
41 | 41 | expect(c.to_s).to eql('x - y') |
42 | 42 | end |
43 | 43 | end |
|
47 | 47 | it 'returns a initialised Basic object that is result of |
48 | 48 | self multiplied by the argument' do |
49 | 49 | c = @a * @b |
50 | | - expect(c).to be_an_instance_of SymEngine::Basic |
| 50 | + expect(c).to be_a SymEngine::Basic |
51 | 51 | expect(c.to_s).to eql('x*y') |
52 | 52 | end |
53 | 53 | end |
|
57 | 57 | it 'returns a initialised Basic object that is result of |
58 | 58 | self divided by the argument' do |
59 | 59 | c = @a / @b |
60 | | - expect(c).to be_an_instance_of SymEngine::Basic |
| 60 | + expect(c).to be_a SymEngine::Basic |
61 | 61 | expect(c.to_s).to eql('x/y') |
62 | 62 | end |
63 | 63 | end |
|
67 | 67 | it 'returns a initialised Basic object that is result of |
68 | 68 | self raised to the power of argument' do |
69 | 69 | c = @a**@b |
70 | | - expect(c).to be_an_instance_of SymEngine::Basic |
| 70 | + expect(c).to be_a SymEngine::Basic |
71 | 71 | expect(c.to_s).to eql('x**y') |
72 | 72 | end |
73 | 73 | end |
|
78 | 78 | and returns the result' do |
79 | 79 | a = @a**3 |
80 | 80 | c = a.diff(@a) |
81 | | - expect(c).to be_an_instance_of SymEngine::Basic |
| 81 | + expect(c).to be_a SymEngine::Basic |
82 | 82 | expect(c).to eq(3 * @a**2) |
83 | 83 | expect(a.diff(2)).to be_nil |
84 | 84 | end |
|
127 | 127 | context "doesn't take any argument" do |
128 | 128 | it 'returns the negation of self' do |
129 | 129 | p = -@x |
130 | | - expect(p).to be_an_instance_of SymEngine::Basic |
| 130 | + expect(p).to be_a SymEngine::Basic |
131 | 131 | expect(p.to_s).to eql('-a') |
132 | 132 | end |
133 | 133 | end |
|
173 | 173 | e = (x + y + z) * (x + y + z) |
174 | 174 | f = e.expand |
175 | 175 | expect(e.to_s).to eql('(x + y + z)**2') |
176 | | - expect(f).to be_an_instance_of SymEngine::Basic |
| 176 | + expect(f).to be_a SymEngine::Basic |
177 | 177 | expect(f.to_s).to eql('2*x*y + 2*x*z + 2*y*z + x**2 + y**2 + z**2') |
178 | 178 | expect(e == f).to be false |
179 | 179 | end |
|
0 commit comments