spec/cg_rect_spec.rb in geomotion-0.14.0 vs spec/cg_rect_spec.rb in geomotion-0.15.0
- old
+ new
@@ -665,10 +665,20 @@
rect = CGRect.make(x: 10.5, y: 10.4, width: 100.025, height: 100.75)
CGRectEqualToRect(rect.round, CGRectMake(11, 10, 100, 101)).should == true
end
end
+ describe "#integral" do
+ it "works" do
+ rect = CGRect.make(x: 10.4, y: 20.5, width: 300.4, height: 400.5).integral
+ rect.origin.x.should == 10
+ rect.origin.y.should == 20
+ rect.size.width.should == 301
+ rect.size.height.should == 401
+ end
+ end
+
describe "#centered_in" do
it "works" do
outer_rect = CGRect.make(width: 100, height: 100)
inner_rect = CGRect.make(width: 50, height: 50)
@@ -1123,9 +1133,16 @@
rect.should == CGRectMake(5, 10, 45, 10)
end
it "should work with absolute" do
rect = @rect.from_bottom(height: 10, absolute: true)
rect.should == CGRectMake(10, 110, 50, 10)
+ end
+ end
+
+ describe '#to_ns_value' do
+ it 'should convert to NSValue' do
+ val = CGRect.new([0, 0], [0, 0]).to_ns_value
+ val.should.be.kind_of(NSValue)
end
end
describe "#to_ary" do
it "should allow parallel assigment" do