Module: Applitools::Calabash::EnvironmentDetector

Extended by:
EnvironmentDetector
Included in:
EnvironmentDetector
Defined in:
lib/applitools/calabash/environment_detector.rb

Instance Method Summary collapse

Instance Method Details

#android?Boolean

Returns:

  • (Boolean)


6
7
8
9
# File 'lib/applitools/calabash/environment_detector.rb', line 6

def android?
  return true if defined?(::Calabash::Android) == 'constant'
  false
end

#current_environmentObject

Raises:

  • (Applitools::EyesError)


16
17
18
19
20
# File 'lib/applitools/calabash/environment_detector.rb', line 16

def current_environment
  return :android if android?
  return :ios if ios?
  raise Applitools::EyesError, 'No calabash environment found!'
end

#ios?Boolean

Returns:

  • (Boolean)


11
12
13
14
# File 'lib/applitools/calabash/environment_detector.rb', line 11

def ios?
  return true if defined?(::Calabash::Cucumber) == 'constant'
  false
end