Sha256: ff14d6ed1537b10b1cae40531da67f9513c3494b825762d889d575842305403f

Contents?: true

Size: 983 Bytes

Versions: 4

Compression:

Stored size: 983 Bytes

Contents

# frozen_string_literal: true

require 'robotstxt'

RSpec.describe GoogleRobotstxtParser do
  include Robotstxt

  let(:context) { GoogleRobotstxtParser.create }

  describe '.VERSION' do
    it 'returns a string' do
      expect(GoogleRobotstxtParser::VERSION).to be_instance_of String
    end
  end

  describe 'allowed_by_robots' do
    it 'should return the true' do
      robotstxt_content = "# robotstxt.org/\n\nUser-agent: *\nDisallow: \n\nSitemap: https://www.bqst.fr/sitemap.xml"
      user_agent = 'GoogleBot'
      url = 'https://www.bqst.fr'

      expect(Robotstxt.allowed_by_robots(robotstxt_content, user_agent, url)).to eq(true)
    end

    it 'should return the true' do
      robotstxt_content = "# robotstxt.org/\n\nUser-agent: *\nDisallow: /\n\nSitemap: https://www.bqst.fr/sitemap.xml"
      user_agent = 'GoogleBot'
      url = 'https://www.bqst.fr'

      expect(Robotstxt.allowed_by_robots(robotstxt_content, user_agent, url)).to eq(false)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
google_robotstxt_parser-0.0.6 spec/google_robotstxt_parser_spec.rb
google_robotstxt_parser-0.0.5 spec/google_robotstxt_parser_spec.rb
google_robotstxt_parser-0.0.4 spec/google_robotstxt_parser_spec.rb
google_robotstxt_parser-0.0.3 spec/google_robotstxt_parser_spec.rb