From f5df1ba7827581a7c771a3deffb6062551611134 Mon Sep 17 00:00:00 2001 From: Postmodern Date: Thu, 4 Aug 2016 19:35:10 -0700 Subject: [PATCH] Only test the first element of status * When using webmock, the `"OK"` String is not present in `StringIO#status`. --- lib/robots.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/robots.rb b/lib/robots.rb index 2ea334e..5589124 100644 --- a/lib/robots.rb +++ b/lib/robots.rb @@ -14,7 +14,7 @@ def initialize(uri, user_agent) io = Robots.get_robots_txt(uri, user_agent) - if !io || io.content_type != "text/plain" || io.status != ["200", "OK"] + if !io || io.content_type != "text/plain" || io.status.first != "200" io = StringIO.new("User-agent: *\nAllow: /\n") end