owasp_zap 0.0.83 → 0.0.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e5fdf9b26110a60007a305236c10a161332a680
4
- data.tar.gz: 2e9bd2b8ec63a92451f6a54f901cd384097218e8
3
+ metadata.gz: efbd0f5b6e82f4035c9ac6b22bd0c76717b41953
4
+ data.tar.gz: dbd86af71ade0eb8abda0de46ab870f82b662989
5
5
  SHA512:
6
- metadata.gz: 7764c5a866bfe1b214384a5845a20f3ca5c9fd2686143780b5c7dbb436a59abdf26349dda75b4ce606628aa53eacc1932da78bb2359e3392ebc17cca66b5fab5
7
- data.tar.gz: 81f57f4e2243a8fde715923fa3d200c620b6b6008780f11afedb95c2799ab696d4e28dfc1dfa2b546b18eb6e4d17a6b92f1cdec662298f049fa9be9e82ed584c
6
+ metadata.gz: 67c6c8f8300671379c6c9d34c7b7739f9430978028550bf8abbe3ede54c81520da0740e42a82a244a1d8857b8b9411493358bdab3d04e7de7cf4cb88201f68ec
7
+ data.tar.gz: 21e6194156ee8ca4553421935c93c79b6a8acddac5acdb6856a1edfeb13bee8cf08654d45957df2b1dd8e358e27700c6a81738d2c91f4ca5335f5d297aef4c5d
@@ -16,7 +16,7 @@ module OwaspZap
16
16
  def status
17
17
  ret = JSON.parse(RestClient::get("#{@base}/ascan/view/status/?zapapiformat=JSON"))
18
18
  if ret.has_key? "status"
19
- ret["status"]
19
+ ret["status"].to_i
20
20
  else
21
21
  100 # it means no running
22
22
  end
@@ -22,7 +22,7 @@ module OwaspZap
22
22
  def status
23
23
  ret = JSON.parse(RestClient::get("#{@base}/spider/view/status/?zapapiformat=JSON"))
24
24
  if ret.has_key? "status"
25
- ret["status"]
25
+ ret["status"].to_i
26
26
  else
27
27
  100 # it means no running
28
28
  end
@@ -1,3 +1,3 @@
1
1
  module OwaspZap
2
- VERSION = "0.0.83"
2
+ VERSION = "0.0.84"
3
3
  end
data/spec/zap_spec.rb CHANGED
@@ -138,4 +138,25 @@ describe "status_for" do
138
138
  it "should return an unknown" do
139
139
  @h.status_for(:foo).wont_be_nil
140
140
  end
141
+
142
+ it "should return an integer" do
143
+ @h.spider.status.must_be_kind_of Numeric
144
+ end
145
+ it "should return an integer" do
146
+ @h.spider.status.must_be_kind_of Numeric
147
+ end
141
148
  end
149
+
150
+ describe "running? method" do
151
+ before do
152
+ @h = Zap::Zap.new :target=>"http://127.0.0.1"
153
+ stub_request(:get, "http://127.0.0.1:8080/JSON/spider/view/status/?zapapiformat=JSON").to_return(:status => 200, :body => {:status=>"90"}.to_json, :headers => {})
154
+ stub_request(:get, "http://127.0.0.1:8080/JSON/ascan/view/status/?zapapiformat=JSON").to_return(:status => 200, :body => {:status=>"100"}.to_json, :headers => {})
155
+ end
156
+ it "should return true" do
157
+ @h.spider.running?.must_equal true
158
+ end
159
+ it "should return false" do
160
+ @h.ascan.running?.must_equal false
161
+ end
162
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: owasp_zap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.83
4
+ version: 0.0.84
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pereira