|
@@ -152,6 +152,27 @@ SpecBegin(MASCompositeConstraint) {
|
|
|
expect(superview.constraints).to.haveCountOf(0);
|
|
|
}
|
|
|
|
|
|
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0
|
|
|
+- (void)testDeactivate
|
|
|
+{
|
|
|
+ NSArray *children = @[
|
|
|
+ [[MASViewConstraint alloc] initWithFirstViewAttribute:view.mas_leading],
|
|
|
+ [[MASViewConstraint alloc] initWithFirstViewAttribute:view.mas_trailing]
|
|
|
+ ];
|
|
|
+ composite = [[MASCompositeConstraint alloc] initWithChildren:children];
|
|
|
+ composite.delegate = delegate;
|
|
|
+ MAS_VIEW *newView = MAS_VIEW.new;
|
|
|
+ [superview addSubview:newView];
|
|
|
+
|
|
|
+ //first equality statement
|
|
|
+ composite.equalTo(newView);
|
|
|
+ [composite install];
|
|
|
+
|
|
|
+ expect(superview.constraints).to.haveCountOf(2);
|
|
|
+ [composite deactivate];
|
|
|
+ expect(superview.constraints).to.haveCountOf(0);}
|
|
|
+#endif
|
|
|
+
|
|
|
|
|
|
- (void)testAttributeChainingShouldCallDelegate {
|
|
|
NSArray *children = @[
|