Permalink
Browse files

more stuff

  • Loading branch information...
1 parent 57951ca commit 12ef60cc8c9309f6fc1cf1ba1292d5c486d48249 @kristianmandrup committed May 5, 2011
Showing with 22 additions and 3 deletions.
  1. +7 −0 spec/geo_magic/shape/circle_spec.rb
  2. +15 −3 spec/geo_magic/shape/rectangle_spec.rb
@@ -4,12 +4,19 @@
context 'a 5.km circle' do
before :each do
@circle = GeoMagic::Circle.new 5.km
+ @radius = GeoMagic::Radius::Circular.create_from @circle
end
describe 'Class' do
it "is a GeoMagic::Circle" do
@circle.should be_a(GeoMagic::Circle)
end
end
+
+ describe '#create_within' do
+ it "creates a new circle within the radius of the circle" do
+ @circle.create_within @radius
+ end
+ end
end
end
@@ -3,7 +3,13 @@
describe GeoMagic::Rectangle do
context 'a 5.km circle' do
before :each do
- @rect = GeoMagic::Rectangle.new @center, 5.km.from(@center, :NW).expand(10.km, :west)
+ @up_left = [1, 1].to_point
+ @up_right = [3, 1].to_point
+ @low_right = [3, 3].to_point
+ @low_left = [1, 3].to_point
+
+ @rect = GeoMagic::Rectangle.new @up_left, @low_right
+ @radius = GeoMagic::Radius::Rectangular.create_from @rect
end
describe 'Class' do
@@ -13,8 +19,7 @@
end
describe '#create_within' do
- it "creates a new rectangle within the radius of the rectangle" do
- radius = GeoMagic::Radius::Rectangular.create_from @rect
+ it "creates a new rectangle within the radius of the rectangle" do
@rect.create_within @radius
end
end
@@ -76,5 +81,12 @@
@rect.lower_right.should == @low_right
end
end
+
+ # describe 'cool dsl' do
+ # it "should reset point_b and all calculated attributes" do
+ # @rect = GeoMagic::Rectangle.new @low_left, 5.km.from(@low_left, :NW)
+ # @rect.expand(10.km, :west)
+ # end
+ # end
end
end

0 comments on commit 12ef60c

Please sign in to comment.