Sha256: 732fc032fdb68a050b2a773eb960c8cff14378b3ca1343b5a540be16b5eec920

Contents?: true

Size: 879 Bytes

Versions: 1

Compression:

Stored size: 879 Bytes

Contents

module AeEasy
  module Core
    module Mock
      # Fake parser that emulates `AnswersEngine` parser executor.
      class FakeParser
        include AeEasy::Core::Mock::FakeExecutor

        # Fake parser exposed methods to isolated context.
        # @private
        #
        # @return [Array]
        def self.exposed_methods
          real_methods = AnswersEngine::Scraper::RubyParserExecutor.exposed_methods.uniq
          mock_methods = [
            :content,
            :failed_content,
            :outputs,
            :pages,
            :page,
            :save_pages,
            :save_outputs,
            :find_output,
            :find_outputs,
            :refetch,
            :reparse
          ].freeze
          AeEasy::Core::Mock::FakeExecutor.check_compatibility real_methods, mock_methods
          mock_methods
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ae_easy-core-0.2.0 lib/ae_easy/core/mock/fake_parser.rb