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

proper escaping of backslashes #291

Merged
merged 3 commits into from
Jan 17, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions calabash-cucumber/lib/calabash-cucumber/uia.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require 'edn'
require 'json'
# required for ruby 1.8
require 'enumerator'

module Calabash
module Cucumber
Expand Down Expand Up @@ -119,6 +121,10 @@ def uia_screenshot(name)
end

def uia_type_string(string, opt_text_before='')
if string.index(/\\/)
indexes = string.enum_for(:scan,/\\/).map { Regexp.last_match.begin(0) }
indexes.reverse.each { |idx| string = string.insert(idx, '\\') }
end
res = uia_handle_command(:typeString, string, opt_text_before)
status = res['status']
if status.eql?('error')
Expand Down
2 changes: 1 addition & 1 deletion calabash-cucumber/lib/calabash-cucumber/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Calabash
module Cucumber
VERSION = '0.9.165'
VERSION = '0.9.166.pre3'
FRAMEWORK_VERSION = '0.9.164'
end
end
1 change: 1 addition & 0 deletions changelog/0.9.166.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- [issue 256](https://github.com/calabash/calabash-ios/issues/256) - touching number pad delete on iOS 7 iphone family devices

- [issue 284]( https://github.com/calabash/calabash-ios/issues/284) - backslashes should be properly escaped when launching with Instruments

### Deprecated

Expand Down