Skip to content

Instantly share code, notes, and snippets.

@jmoody
Created January 15, 2014 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmoody/8434632 to your computer and use it in GitHub Desktop.
Save jmoody/8434632 to your computer and use it in GitHub Desktop.
example of ruby module and cucumber world
# this might be too deep a module
# 3 is usually the max depth, but in x-platform
# i like to mirror the directory structure
# you can do what ever you like
module YourProjectName
module iOS
module Helpers
module Utils
def global_error_messages_view_selector
"view class:'GlobalErrorMessagesView"
end
def assert_validation_error_message(validation_error_message)
if element_exists(global_error_messages_view_selector)
query(global_error_messages_view_selector + " label marked:#{validation_error_message}")
end
end
end
end
end
# add this to the cucumber World object
World(YourProjectName:iOS:Utils)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment