Sha256: 28002d7b872d68a0692908770d594d016079c813ce3a76d5261ef2cf954558cd

Contents?: true

Size: 911 Bytes

Versions: 2

Compression:

Stored size: 911 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

        check_name 'caching'
        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

2 entries across 2 versions & 1 rubygems

Version Path
headdesk-0.5.0 lib/headdesk/checks/teak/caching.rb
headdesk-0.4.0 lib/headdesk/checks/teak/caching.rb