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)


8
9
10
11
# File 'lib/applitools/calabash/environment_detector.rb', line 8

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

#current_environmentObject

Raises:

  • (Applitools::EyesError)


18
19
20
21
22
# File 'lib/applitools/calabash/environment_detector.rb', line 18

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

#ios?Boolean

Returns:

  • (Boolean)


13
14
15
16
# File 'lib/applitools/calabash/environment_detector.rb', line 13

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