scraper_test.go 607 B

123456789101112131415161718192021
  1. // Copyright 2017 Frédéric Guillot. All rights reserved.
  2. // Use of this source code is governed by the Apache 2.0
  3. // license that can be found in the LICENSE file.
  4. package scraper
  5. import "testing"
  6. func TestGetPredefinedRules(t *testing.T) {
  7. if getPredefinedScraperRules("http://www.phoronix.com/") == "" {
  8. t.Error("Unable to find rule for phoronix.com")
  9. }
  10. if getPredefinedScraperRules("https://www.linux.com/") == "" {
  11. t.Error("Unable to find rule for linux.com")
  12. }
  13. if getPredefinedScraperRules("https://example.org/") != "" {
  14. t.Error("A rule not defined should not return anything")
  15. }
  16. }