rubymotion-community / BubbleWrap

Cocoa wrappers and helpers for RubyMotion (Ruby for iOS and OS X) - Making Cocoa APIs more Ruby like, one API at a time. Fork away and send your pull requests
Other
1.18k stars 208 forks source link

[iOS] Add Device.force_touch? #478

Closed hboon closed 8 years ago

markrickert commented 8 years ago

Nice! I'm wondering if tests for this would be of any benefit?

hboon commented 8 years ago

Do you mean test as in a spec for this or whether this is useful? For the former, I'm not sure how to write one, other than verifying that it's false (because it's in the simulator)?

markrickert commented 8 years ago

Oh, i definitely think it's useful... but tests can run on the device as well. The test should probably check to see what device it is and if it's a 6s or a 6s Plus, it should return true.

hboon commented 8 years ago

Ah, OK.

I usually use this: https://gist.github.com/hboon/e22943f155cc628c782d. I don't think -moHardwareString can be translated to RubyMotion though. Any idea how to check for device type otherwise?

hboon commented 8 years ago

I want to get this in patch in because I'm already using it :) Anyone have any idea how to write a test for this? Ping @clayallsopp @colinta for help.

(The Travis failure looks unrelated).

colinta commented 8 years ago

Cool! I'm until the sim adds support, we can't test it. I'll take a look and merge soon.

On Jan 15, 2016, at 11:06 PM, Hwee-Boon Yar notifications@github.com wrote:

I want to get this in patch in because I'm already using it :) Anyone have any idea how to write a test for this? Ping @clayallsopp @colinta for help.

(The Travis failure looks unrelated).

― Reply to this email directly or view it on GitHub.

hboon commented 8 years ago

@colinta did you have a chance to look at this? Want to get rid of my private fork :)

colinta commented 8 years ago

Ah yes, thank's for reminding me! @markrickert I'm gonna punt on requiring specs, because those won't be picked up in automated testing. If he's been using this code successfully this whole time than it's obviously working, that's good enough for me.

hboon commented 8 years ago

@colinta thanks!

markrickert commented 8 years ago

lol, no worries... I'm pretty sure it's not possible to automate the testing for this.