UIButtonRACSupportSpec.m 961 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // UIButtonRACSupportSpec.m
  3. // ReactiveCocoa
  4. //
  5. // Created by Ash Furrow on 2013-06-06.
  6. // Copyright (c) 2013 GitHub, Inc. All rights reserved.
  7. //
  8. #import <Quick/Quick.h>
  9. #import <Nimble/Nimble.h>
  10. #import "RACControlCommandExamples.h"
  11. #import "RACTestUIButton.h"
  12. #import "UIButton+RACCommandSupport.h"
  13. #import "RACCommand.h"
  14. #import "RACDisposable.h"
  15. QuickSpecBegin(UIButtonRACSupportSpec)
  16. qck_describe(@"UIButton", ^{
  17. __block UIButton *button;
  18. qck_beforeEach(^{
  19. button = [RACTestUIButton button];
  20. expect(button).notTo(beNil());
  21. });
  22. qck_itBehavesLike(RACControlCommandExamples, ^{
  23. return @{
  24. RACControlCommandExampleControl: button,
  25. RACControlCommandExampleActivateBlock: ^(UIButton *button) {
  26. #pragma clang diagnostic push
  27. #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
  28. [button sendActionsForControlEvents:UIControlEventTouchUpInside];
  29. #pragma clang diagnostic pop
  30. }
  31. };
  32. });
  33. });
  34. QuickSpecEnd