Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frameworks #15

Merged
merged 14 commits into from
Feb 8, 2016
Merged

Frameworks #15

merged 14 commits into from
Feb 8, 2016

Conversation

ashfurrow
Copy link
Owner

OK so this does a lot:

  • Forgeries wasn't working when installed under frameworks because of has_include weirdness, so I took it out and moved mock-related stuff just to the Mocks subspec. This makes it easier to maintain, but it's a breaking change, but we're pre-1.0 so following the CocoaPods philosophy: http://media3.giphy.com/media/DHgmBovno9Mli/giphy.gif
  • Adds stubbing for trait collections on the two classes I know of that conform to UITraitEnvironment: UIView and UIViewController.
  • Adds unit tests for testing our trait-stubbing.

Note that I chose stubbing as an approach instead of something else. Why? The UITraitEnvironment protocol contains the logic we're trying to stub, a readonly property. Subclassing was considered but every class-under-test would need to be subclassed, which is a pain. Stubbing works.

Fixes #13.

@ashfurrow
Copy link
Owner Author

Oh and I removed the Pods directory. If I shouldn't have, someone tell me.

@@ -0,0 +1,15 @@
@import UIKit;

#define ExtendTraitEnvironment(specific_class) \
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would've done this with Swift protocol extensions but couldn't get it figured out.

PODFILE CHECKSUM: 2c0c73dfeef5174af308d83c7d6c5ec25554150d

COCOAPODS: 1.0.0.beta.2
COCOAPODS: 0.39.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tsk tsk

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Send a PR with a Gemfile 😛

@ashfurrow ashfurrow mentioned this pull request Feb 8, 2016
3 tasks
@ashfurrow
Copy link
Owner Author

OK, updated to CocoaPods 1.0 beta thingy, also split out mock-specific stuff into the subspec.

ashfurrow added a commit that referenced this pull request Feb 8, 2016
@ashfurrow ashfurrow merged commit 95219d5 into master Feb 8, 2016
@ashfurrow ashfurrow deleted the frameworks branch February 8, 2016 23:11
@orta
Copy link
Collaborator

orta commented Feb 8, 2016

ace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants