Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
refactor: rubocop --auto-correct
Browse files Browse the repository at this point in the history
  • Loading branch information
ninoseki committed Aug 28, 2019
1 parent fd6a94c commit f0ff61f
Show file tree
Hide file tree
Showing 48 changed files with 51 additions and 50 deletions.
2 changes: 1 addition & 1 deletion app/lib/rack/spyup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def response_from_rule(rule)

def startup_information
STDOUT.puts "#{mrr.valid_rules.length} matching rule(s) loaded."
STDERR.puts "#{mrr.invalid_rules.length} matching rule(s) failed to load: #{mrr.invalid_rules.map(&:path).join(',')}." unless mrr.invalid_rules.empty?
warn "#{mrr.invalid_rules.length} matching rule(s) failed to load: #{mrr.invalid_rules.map(&:path).join(',')}." unless mrr.invalid_rules.empty?
end

# Returns an access information for logging.
Expand Down
2 changes: 1 addition & 1 deletion spec/hunter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

describe SleepWarm::Hunter do
it "should return if given an input include 'wget'" do
it "returns if given an input include 'wget'" do
hunt = subject.hunt("wget http://example.com/hoge.bin")
expect(hunt).to be_a(Array)
expect(hunt.length).to eq(1)
Expand Down
5 changes: 3 additions & 2 deletions spec/mrr_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@

describe "#find" do
context "input doesn't match any rule" do
it "should return false" do
it "returns false" do
input = { method: "NOPE", uri: "NOP" }
res = subject.find(input)
expect(res).to eq(nil)
end
end

context "input matches a rule" do
it "should return true" do
it "returns true" do
input = { method: "GET", uri: "/login" }
res = subject.find(input)
expect(res).to be_a(SleepWarm::Rule)
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1001_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1001)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/login'
expect(last_response.status).to eq(200)
expect(last_response.body).not_to be_empty
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1002_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1002)" do
it "should log the rule id" do
it "logs the rule id" do
post 'http://example.com/login'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("login failed.")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1003_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1003)" do
it "should log the rule id" do
it "logs the rule id" do
head 'http://example.com/login'
expect(last_response.status).to eq(200)
expect(last_response.body).not_to be_empty
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1004_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1004)" do
it "should log the rule id" do
it "logs the rule id" do
options 'http://example.com/'
expect(last_response.status).to eq(200)
expect(last_response.body).not_to be_empty
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1005_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1005)" do
it "should log the rule id" do
it "logs the rule id" do
put 'http://example.com/'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("file created.")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1006_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1006)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/robots.txt'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("User-agent")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1007_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1007)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/phpMyAdmin/'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("phpmyadmin")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1008_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1008)" do
it "should log the rule id" do
it "logs the rule id" do
post 'http://example.com/command.php'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("610cker")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1009_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1009)" do
it "should log the rule id" do
it "logs the rule id" do
header "User-Agent", "Struts2045"
get 'http://example.com/'
expect(last_response.status).to eq(200)
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1010_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1010)" do
it "should log the rule id" do
it "logs the rule id" do
header "User-Agent", "echo 2014 | md5sum"
get 'http://example.com/'
expect(last_response.status).to eq(200)
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1011_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1011)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/wp-login.php'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("blog login")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1012_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1012)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/getcfg.php'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("DEVICE.ACCOUNT")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1013_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1013)" do
it "should log the rule id" do
it "logs the rule id" do
header "User-Agent", "whoami"
get 'http://example.com/'
expect(last_response.status).to eq(200)
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1014_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1014)" do
it "should log the rule id" do
it "logs the rule id" do
post 'http://example.com/', "whoami"
expect(last_response.status).to eq(200)
expect(last_response.body).to include("root")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1015_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1015)" do
it "should log the rule id" do
it "logs the rule id" do
header "User-Agent", "/etc/passwd"
get 'http://example.com/'
expect(last_response.status).to eq(200)
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1016_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1016)" do
it "should log the rule id" do
it "logs the rule id" do
post 'http://example.com/', "/etc/passwd"
expect(last_response.status).to eq(200)
expect(last_response.body).to include("root")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1017_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1017)" do
it "should log the rule id" do
it "logs the rule id" do
header "User-Agent", "echo 2014;uname -a;w;id;echo 2015"
get 'http://example.com/'
expect(last_response.status).to eq(200)
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1018_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1018)" do
it "should log the rule id" do
it "logs the rule id" do
post 'http://example.com/', "echo 2014;uname -a;w;id;echo 2015"
expect(last_response.status).to eq(200)
expect(last_response.body).to include("2014")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1019_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1019)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/etc/passwd'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("root")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1020_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1020)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/test.jsp'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("ok")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1021_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1021)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/diZPqEAuJM.jsp'
expect(last_response.status).to eq(200)
expect(last_response.body).to eq("42d388f8b1db997faaf7dab487f11290")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1022_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1022)" do
it "should log the rule id" do
it "logs the rule id" do
custom_request('PROPFIND', 'http://example.com/')
expect(last_response.status).to eq(200)
expect(last_response.body).to include("ok")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1023_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1023)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/setup.cgi'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("ok")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1024_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1024)" do
it "should log the rule id" do
it "logs the rule id" do
post 'http://example.com/', "getcfg/DEVICE.ACCOUNT.xml"
expect(last_response.status).to eq(200)
expect(last_response.body).to include("DEVICE.ACCOUNT")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1025_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1025)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/invoker/readonly'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("JBoss")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1026_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1026)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/HTTPServerILServlet'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("JBoss")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1027_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1027)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/axis2'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("JBoss")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1028_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1028)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/admin-console/'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("JBoss")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1029_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1029)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/jmx-console/'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("JBoss")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1030_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1030)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/jbossws/'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("JBoss")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1031_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1031)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/manager/status'
expect(last_response.status).to eq(401)
expect(last_response.body).to include("401")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1032_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1032)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/manager/html'
expect(last_response.status).to eq(401)
expect(last_response.body).to include("401")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1033_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1033)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/host-manager/html'
expect(last_response.status).to eq(401)
expect(last_response.body).to include("401")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1034_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1034)" do
it "should log the rule id" do
it "logs the rule id" do
header "User-Agent", "dG9tY2F0OnBhc3N3b3JkCg=="
get 'http://example.com/manager/'
expect(last_response.status).to eq(200)
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1035_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1035)" do
it "should log the rule id" do
it "logs the rule id" do
header "User-Agent", "echo linux--2017"
get 'http://example.com/'
expect(last_response.status).to eq(200)
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1036_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1036)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/cmx.php'
expect(last_response.status).to eq(200)
expect(last_response.body).to eq("CMD2017")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1037_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1037)" do
it "should log the rule id" do
it "logs the rule id" do
post 'http://example.com/', "pi%28%29%2A42"
expect(last_response.status).to eq(200)
expect(last_response.body).to eq("131.94689145077")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1038_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1038)" do
it "should log the rule id" do
it "logs the rule id" do
post 'http://example.com/', "ZGllKHBpKCkqNDIpOw"
expect(last_response.status).to eq(200)
expect(last_response.body).to eq('131.94689145077')
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1039_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1039)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com/wp-config.php'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("WordPress")
Expand Down
2 changes: 1 addition & 1 deletion spec/rules/1040_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
include_context "spyup testing"

context "Request which is matched a rule(id = 1040)" do
it "should log the rule id" do
it "logs the rule id" do
get 'http://example.com//wls-wsat/CoordinatorPortType'
expect(last_response.status).to eq(500)
expect(last_response.body).to include("Web Service")
Expand Down
Loading

0 comments on commit f0ff61f

Please sign in to comment.