sonar-client 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28d19291140201d88ac436b2d42ab047c477acde
4
- data.tar.gz: 3f3115c49a108f3d175f0ea670348ec89835e37e
3
+ metadata.gz: 44bc1c4f74efaf45f7278f7d6c9088aac904ba12
4
+ data.tar.gz: 4eefe89872fa73d36ee480cbdea39bd259937e73
5
5
  SHA512:
6
- metadata.gz: 25251c5d02b60a2afaad1af4ddac7cdf1e85e13fee30b4e89def0f95f1d5aee0de867bbcf6a1665128a6a44c81b75e6e5f5f1a1c5ffa98800921e95974179bfa
7
- data.tar.gz: b6cb3e46073c83cd24de84c9abf9a27d4b348e28a8d889309d1f0640a77d2785504be243d8b9ecf88f9640c375d6a779f5c31f5f2fe43b958a3d02eb2b41719d
6
+ metadata.gz: 2c1a22b2aa4749e1d86d88d146bdcbb983d3f15f4b4fdc690915dd1f88c25c026e4df50025b3884d924ac38f73938a70401ca448f07ce2d8ecdda2ef77c4e403
7
+ data.tar.gz: 7ee849d4e4e84add1cad073fcf1b9d507ba987fd7e28aa870a19677fe4fb0d6963da88dc9c69078fadbfea66eebe9e89a3a2bcab3be15506ab651838d6eca708
data/lib/sonar/client.rb CHANGED
@@ -92,7 +92,7 @@ module Sonar
92
92
  # @return [String] the Sonar API version to use
93
93
  def default_api_version
94
94
  begin
95
- Sonar.api_version
95
+ Sonar.api_version || 'v2'
96
96
  rescue NoMethodError
97
97
  'v2'
98
98
  end
data/lib/sonar/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sonar
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -5,28 +5,36 @@ describe Sonar::Registration do
5
5
  let(:client) { Sonar::Client.new }
6
6
 
7
7
  context 'POSTing a valid product key' do
8
- let (:resp) { client.register_metasploit("1e80c24b97c928bb1db7d4d3c05475a6a40a1186") }
8
+ let (:resp) do
9
+ VCR.use_cassette("valid_ms_registration") do
10
+ client.register_metasploit("SOME-VALID-KEY")
11
+ end
12
+ end
9
13
 
10
- xit 'responds that the license is valid' do
14
+ it 'responds that the license is valid' do
11
15
  expect(resp).to have_key('valid')
12
16
  expect(resp['valid']).to be(true)
13
17
  end
14
- xit 'responds with a user email' do
18
+ it 'responds with a user email' do
15
19
  expect(resp).to have_key('email')
16
- expect(resp['email']).to match(/@/)
20
+ expect(resp['email']).to eq('metasploit-sdafsaefaef@rapid7.com')
17
21
  end
18
- xit 'responds with an api_key' do
22
+ it 'responds with an api_key' do
19
23
  expect(resp).to have_key('api_key')
20
- expect(resp['api_key']).to match(/KEY/)
24
+ expect(resp['api_key']).to match('YOUR-VALID-API-KEY')
21
25
  end
22
26
  end
23
27
 
24
28
  context 'POSTing an invalid product key' do
25
29
  let (:resp) { client.register_metasploit("DDXXXX") }
26
30
 
27
- xit 'responds that the license is invalid' do
31
+ it 'responds that the license is invalid' do
28
32
  expect(resp).to have_key('valid')
29
33
  expect(resp['valid']).to be(false)
30
34
  end
35
+ it 'responds with an error message' do
36
+ expect(resp).to have_key('error')
37
+ expect(resp['error']).to match(/not appear to be valid/)
38
+ end
31
39
  end
32
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sonar-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Deardorff & HD Moore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-18 00:00:00.000000000 Z
11
+ date: 2015-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday_middleware