Sha256: eec13fed9cf233198a1c0d3060f269066f0ac10fb854577aecab3db1ddfd8fd3
Contents?: true
Size: 1.23 KB
Versions: 1
Compression:
Stored size: 1.23 KB
Contents
require 'spec_helper' describe GeometricPoint do describe '#initialize_by_numbers' do point = GeometricPoint.new(1, 2) it 'to be equal' do expect(point.x).to eq(1) expect(point.y).to eq(2) end it 'to be not equal' do expect(point.x).not_to eq(3) expect(point.y).not_to eq(3) end end describe '#initialize_by_array' do point = GeometricPoint.new_by_array([1, 2]) it 'to be equal' do expect(point.x).to eq(1) expect(point.y).to eq(2) end it 'to be not equal' do expect(point.x).not_to eq(3) expect(point.y).not_to eq(3) end end describe '#advance_by' do it 'to be the addition of a point to a vector' do point = GeometricPoint.new(1, 2) vector = GeometricVector.new(2, -1) expect(point.advance_by(vector)).to eq(GeometricPoint.new(3, 1)) end end describe '#to_vector' do it 'to be converted to a vector' do expect(GeometricPoint.new(1, 2).to_vector).to eq(GeometricVector.new(1, 2)) end end describe '#==' do it 'to be converted to a vector' do point = GeometricPoint.new(1, 2) expect(point == point).to eq(true) expect(point == GeometricPoint.new(1, 3)).to eq(false) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
flash_math-0.0.1 | spec/lib/geometry/geometric_point_spec.rb |