webtrends 0.0.1 → 0.0.2

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: 88af47c8840f1c9a5152ad58bdddbb2348829270
4
- data.tar.gz: 9d990d0d6a755bab23ba73f8389cd80b3797d521
3
+ metadata.gz: 5c74e3b990f00568630ee09f45384f1016d3b608
4
+ data.tar.gz: de94061061088e1e290fcaad207b636f1106f8fc
5
5
  SHA512:
6
- metadata.gz: 10c05f208024257f0bd6e4d7ef7bd2afe1fd244132afb03c5e02536c0bd7748c1c4a7516c3b0c62128451c89e9e9803fc9d7331c3292bfab677dd592ef39cdfe
7
- data.tar.gz: 2d6d60b1e49d77cc7a54b4e75330e889c7cca86802251b4a0c78c802b6e6c3b122d6b4251cee582f2e4e01c67821bf6974ef539d810dea86a2243ebd5a46b22c
6
+ metadata.gz: 6a8be94c2a5a29b62177d623088ff1b8d0ca2c91998cf394a073bcc67c9aee79b166a63f56e380a1e7d8fa5e7b9fd01cb6b4d43b93cac35cc25c013f6bfd4a6b
7
+ data.tar.gz: 60472dc8861ef79378dfedd01308d50802b08ce9bbfb971fe6ed1c1e76de5d1dd92a28f22e7f0d50ab5bb732717ed8fdd1299ef946d27126b0d9828e68838231
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ vendor
@@ -10,7 +10,7 @@ module Webtrends
10
10
  end
11
11
 
12
12
  def track
13
- if !tags.empty?
13
+ if !tags.nil? && !tags.empty?
14
14
  RestClient.post endpoint, options.merge(tags)
15
15
  end
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module Webtrends
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -25,7 +25,7 @@ describe Webtrends::Event do
25
25
  expect(response.code).to eq(200)
26
26
  end
27
27
 
28
- it 'should merge tags and options' do
28
+ it 'merges tags and options' do
29
29
  RestClient.stub(:post).and_return(successful_response)
30
30
  subject.tags = {'dcsuri' => '/waffles'}
31
31
  expect(RestClient).to receive(:post).with(subject.send(:endpoint), subject.tags.merge(subject.send(:options)))
@@ -34,7 +34,7 @@ describe Webtrends::Event do
34
34
  end
35
35
 
36
36
  context 'unsuccessful response' do
37
- it 'should trigger an exception' do
37
+ it 'triggers an exception' do
38
38
  RestClient.stub(:post).and_raise(RestClient::BadRequest.new '400 Bad Request')
39
39
  subject.tags = {'WT.ti' => 'waffles'}
40
40
  begin
@@ -45,32 +45,35 @@ describe Webtrends::Event do
45
45
  expect(response).to be_nil
46
46
  end
47
47
 
48
- it 'should not call webtrends if tags is empty' do
48
+ it 'does not call webtrends if tags is empty' do
49
+ expect(RestClient).to_not receive(:post)
50
+ response = subject.track
51
+ end
52
+
53
+ it 'does not call webtrends if tags is nil' do
54
+ subject.tags = nil
49
55
  expect(RestClient).to_not receive(:post)
50
56
  response = subject.track
51
57
  end
52
58
  end
53
59
  end
54
60
 
55
- describe '#initialize' do
56
- context 'not passing default configuraiton' do
57
- it 'uses default config attributes' do
61
+ describe '.initialize' do
62
+ context 'not passing custom configuration' do
63
+ it 'uses default configuration' do
58
64
  expect(subject.customer_id).to eq(default_configuration.customer_id)
59
65
  expect(subject.verbose).to eq(default_configuration.verbose)
60
66
  expect(subject.format).to eq(default_configuration.format)
61
67
  end
62
68
  end
63
69
 
64
- context 'passing default configuraiton' do
70
+ context 'passing custom configuration' do
65
71
  let(:custom_configuration) do
66
- OpenStruct.new(
67
- customer_id: 'somedifferent',
68
- verbose: true,
69
- format: 'plain')
72
+ { customer_id: 'somedifferent', verbose: true, format: 'plain' }
70
73
  end
71
74
 
72
- let(:subject) { Webtrends::Event.new(custom_configuration.to_h) }
73
- it 'does not uses default config attributes' do
75
+ let(:subject) { Webtrends::Event.new(custom_configuration) }
76
+ it 'does not use default configuration' do
74
77
  expect(subject.customer_id).to_not eq(default_configuration.customer_id)
75
78
  expect(subject.verbose).to_not eq(default_configuration.verbose)
76
79
  expect(subject.format).to_not eq(default_configuration.format)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webtrends
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael van den Beuken
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2014-02-19 00:00:00.000000000 Z
16
+ date: 2014-02-21 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: bundler