Sha256: 34cdb74b21e2ab484b4a478ab4075675231d074459bd28c8091cceb520ad1ccc

Contents?: true

Size: 468 Bytes

Versions: 1

Compression:

Stored size: 468 Bytes

Contents

require 'spec_helper'
require 'straightedge/extend/array'
require 'straightedge/compass'
require 'straightedge/rose'
require 'straightedge/ruler'
require 'straightedge/figure'

describe Straightedge::Figure do
  it 'should compute adjacent positions' do
    expect([[0,0]].adjacent).to eql([[0, -1], [0, 1], [1, 0], [-1, 0], [1, -1], [1, 1], [-1, -1], [-1, 1]]) #[0,1])
  end

  it 'should compute centroid' do
    expect([[0,0],[2,2]].center).to eql([1,1])
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
straightedge-0.1.0 spec/straightedge/figure_spec.rb