Sha256: 793451b4169fdd53734f5e923aefcee8dc2956da9518a4e961bbc35b5e9517d6

Contents?: true

Size: 981 Bytes

Versions: 3

Compression:

Stored size: 981 Bytes

Contents

class TestHelper
  def self.ios6
    UIDevice.currentDevice.systemVersion.to_f >= 6.0 &&
    UIDevice.currentDevice.systemVersion.to_f < 7.0
  end

  def self.ios7
    UIDevice.currentDevice.systemVersion.to_f >= 7.0 &&
    UIDevice.currentDevice.systemVersion.to_f < 8.0
  end

  def self.ios8
    UIDevice.currentDevice.systemVersion.to_f >= 8.0 &&
    UIDevice.currentDevice.systemVersion.to_f < 9.0
  end
end

def silence_warnings(&block)
  warn_level = $VERBOSE
  $VERBOSE = nil
  begin
    result = block.call
  ensure
    $VERBOSE = warn_level
  end
  result
end

silence_warnings do
  module Bacon
    if ENV['filter']
      $stderr.puts "Filtering specs that match: #{ENV['filter']}"
      RestrictName = Regexp.new(ENV['filter'])
    end

    if ENV['filter_context']
      $stderr.puts "Filtering contexts that match: #{ENV['filter_context']}"
      RestrictContext = Regexp.new(ENV['filter_context'])
    end

    Backtraces = false if ENV['hide_backtraces']
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ProMotion-2.2.0 spec/helpers/test_helper.rb
ProMotion-2.1.0 spec/helpers/test_helper.rb
ProMotion-2.1.0.beta1 spec/helpers/test_helper.rb