Created
July 28, 2016 06:52
-
-
Save ainoya/b885a39ea03958a7663a62246ad0366e to your computer and use it in GitHub Desktop.
matcher for comparing string as uf8-mac coded string in test iOS app via appium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec::Matchers.define :eq_as_utf8_mac do |expected| | |
match do |actual| | |
actual.force_encoding('UTF8-MAC') === expected.encode('UTF8-MAC') | |
end | |
end | |
expected = 'ぱぴぷぺぽ' | |
# actual = 'ぱぴぷぺぽ' gots from iOS App through appium server. | |
expect(find(actual).name.strip) | |
.to eq_as_utf8_mac(expected) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment