Sha256: cd1c4281c016cf29c3672762c737a38c894e9962ff85071f369ab91278b3dd00

Contents?: true

Size: 682 Bytes

Versions: 2

Compression:

Stored size: 682 Bytes

Contents

require 'minitest/autorun'
require 'legitbot'

class BotMatchTest < Minitest::Test
  def test_reverse_name
    match = Legitbot::BotMatch.new "66.249.78.6"
    assert_equal "crawl-66-249-78-6.googlebot.com", match.reverse_name
  end

  def test_reverse_ip
    match = Legitbot::BotMatch.new "66.249.78.6"
    assert_equal "66.249.78.6", match.reversed_ip
  end

  def test_reverse_resolves
    match = Legitbot::BotMatch.new "66.249.78.6"
    assert_equal true, match.reverse_resolves?
  end

  def test_valid_class_syntax
    assert Legitbot::Google.valid?("66.249.78.6"), msg: "Valid Googlebot"
    assert Legitbot::Google.fake?("149.210.164.47"), msg: "Fake Googlebot"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
legitbot-0.1.0 test/botmatch_test.rb
legitbot-0.0.1 test/botmatch_test.rb