Skip to content

Commit

Permalink
Added tests for composite constraint activation
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Mazurin committed Sep 22, 2014
1 parent 838cea8 commit 7722163
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion Tests/Specs/MASCompositeConstraintSpec.m
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,30 @@ - (void)testDeactivate

expect(superview.constraints).to.haveCountOf(2);
[composite deactivate];
expect(superview.constraints).to.haveCountOf(0);}
expect(superview.constraints).to.haveCountOf(0);
}

- (void)testActivate
{
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);
[composite activate];
expect(superview.constraints).to.haveCountOf(2);
}
#endif


Expand Down

0 comments on commit 7722163

Please sign in to comment.