Sha256: a63b25e6979f1f0e2138d362876f817570e022685a4288f205ca7fb4485a763f

Contents?: true

Size: 882 Bytes

Versions: 3

Compression:

Stored size: 882 Bytes

Contents

# frozen_string_literal: true

module Headdesk
  module Checks
    module Teak
      #
      # Check to make sure that an APK, which uses Teak, has caching enabled.
      #
      class Caching
        include Checks::Teak::APK

        describe 'Check for io_teak_enable_caching'
        def call
          describe 'Teak SDK version is lower than 2.0.0'
          major, = apk.find_class('io.teak.sdk.Teak')
                      .field('SDKVersion')
                      .value
                      .to_version
          skip_check if: major.to_i >= 2

          describe "APK enables caching of Teak notification content (via 'io_teak_enable_caching')"
          fail_check unless: apk.resources
                                .values(v: 21)
                                .bool
                                .io_teak_enable_caching
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
headdesk-0.3.0 lib/headdesk/checks/teak/caching.rb
headdesk-0.2.0 lib/headdesk/checks/teak/caching.rb
headdesk-0.1.0 lib/headdesk/checks/teak/caching.rb