Sha256: ca18dd118fdb0c7b8bf59e06c5cc8f9fcbe6524015bbe3763d6c6829e08d9768
Contents?: true
Size: 810 Bytes
Versions: 20
Compression:
Stored size: 810 Bytes
Contents
# frozen_string_literal: true require_relative 'test_helper' class OracleTest < Minitest::Test def test_malicious_ip ip = '149.210.164.47' match = Legitbot::Oracle.new ip refute_predicate match, :valid? end def test_valid_ip ip = '148.64.56.64' match = Legitbot::Oracle.new ip assert_predicate match, :valid? end def test_malicious_ua bot = Legitbot.bot( 'Mozilla/5.0 (compatible; GrapeshotCrawler/2.0; +http://www.grapeshot.co.uk/crawler.php)', '149.210.164.47' ) assert bot refute_predicate bot, :valid? end def test_valid_ua bot = Legitbot.bot( 'Mozilla/5.0 (compatible; GrapeshotCrawler/2.0; +http://www.grapeshot.co.uk/crawler.php)', '148.64.56.64' ) assert bot assert_predicate bot, :valid? end end
Version data entries
20 entries across 20 versions & 1 rubygems