Sha256: a782ac5d48a2de75f9102351f11c133ae39cba6c86186675aabcf85a0bd7cac4

Contents?: true

Size: 1.12 KB

Versions: 2

Compression:

Stored size: 1.12 KB

Contents

require 'spec_helper'
require 'straightedge'

describe Straightedge do
  it "should have a VERSION constant" do
    subject.const_get('VERSION').should_not be_empty
  end

  context "contracts" do

    context "example scene" do
      let(:scene) { Director.new.current_scene }
      it "should be constructed without issues" do
	expect { scene.render }.not_to raise_error
      end

    end

    context "classical constructions" do
=begin
    the classical straightedge and compass constructions: 

      - Creating the line through two existing points
      - Creating the circle through one point with centre another point
      - Creating the point which is the intersection of two existing, non-parallel lines
      - Creating the one or two points in the intersection of a line and a circle (if they intersect)
      - Creating the one or two points in the intersection of two circles (if they intersect).
=end

      describe "creating a line between two points" do
	let(:a) { [0,4] }
	let(:b) { [3,0] }

	let(:line) { Line.new([a,b]) }

	it 'should have length 5' do
	  expect(line.length).to eql(5.0)
	end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
straightedge-0.1.2 spec/straightedge_spec.rb
straightedge-0.1.1 spec/straightedge_spec.rb