Module: Calabash::Utils

Defined in:
lib/calabash-android/utils.rb

Class Method Summary collapse

Class Method Details

.with_silent_zip(&block) ⇒ Object


5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/calabash-android/utils.rb', line 5

def self.with_silent_zip(&block)
  previous_value = false

  if Zip.respond_to?(:warn_invalid_date)
    previous_value = Zip.warn_invalid_date
  end

  if Zip.respond_to?(:warn_invalid_date=)
    Zip.warn_invalid_date = false
  end

  r = block.call

  if Zip.respond_to?(:warn_invalid_date=)
    Zip.warn_invalid_date = previous_value
  end

  r
end