test/geometry/point.rb in geometry-6.5 vs test/geometry/point.rb in geometry-6.6
- old
+ new
@@ -13,10 +13,19 @@
it 'must generate a Point full of ones' do
Point.one(3).must_equal Point[1,1,1]
end
+ it 'must generate a PointIso' do
+ Point.iso(3).must_be_kind_of(PointIso)
+ Point.iso(3).value.must_equal 3
+ end
+
+ it 'must generate a Point filled with a given value' do
+ Point.iso(3, 2).must_equal Point[3,3]
+ end
+
it "must generate a PointZero" do
Point.zero.must_be_instance_of(PointZero)
end
it "must generate a Point full of zeros" do
@@ -307,9 +316,18 @@
describe "when multiplying" do
it "must return a Point when multiplied by a Matrix" do
(Matrix[[1,2],[3,4]]*Point[5,6]).must_equal Point[17, 39]
end
+ end
+ end
+
+ describe 'attributes' do
+ it 'must have a quadrant' do
+ Point[1,1].quadrant.must_equal 1
+ Point[-1,1].quadrant.must_equal 2
+ Point[-1,-1].quadrant.must_equal 3
+ Point[1,-1].quadrant.must_equal 4
end
end
describe "coercion" do
subject { Point[1,2] }