View+MASAdditionsSpec.m 794 B

12345678910111213141516171819202122232425262728293031
  1. //
  2. // View+MASAdditionsSpec.m
  3. // Masonry
  4. //
  5. // Created by Jonas Budelmann on 8/09/13.
  6. // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
  7. //
  8. #import "View+MASAdditions.h"
  9. SpecBegin(View_MASAdditions)
  10. - (void)testSetTranslatesAutoresizingMaskIntoConstraints {
  11. MAS_VIEW *newView = MAS_VIEW.new;
  12. [newView mas_makeConstraints:^(MASConstraintMaker *make) {
  13. expect(make.updateExisting).to.beFalsy();
  14. }];
  15. expect(newView.translatesAutoresizingMaskIntoConstraints).to.beFalsy();
  16. }
  17. - (void)testSetUpdateExisting {
  18. MAS_VIEW *newView = MAS_VIEW.new;
  19. [newView mas_updateConstraints:^(MASConstraintMaker *make) {
  20. expect(make.updateExisting).to.beTruthy();
  21. }];
  22. expect(newView.translatesAutoresizingMaskIntoConstraints).to.beFalsy();
  23. }
  24. SpecEnd