webtrends 0.0.1 → 0.0.2
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 +4 -4
- data/.gitignore +1 -0
- data/lib/webtrends/event.rb +1 -1
- data/lib/webtrends/version.rb +1 -1
- data/spec/event_spec.rb +16 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c74e3b990f00568630ee09f45384f1016d3b608
|
4
|
+
data.tar.gz: de94061061088e1e290fcaad207b636f1106f8fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a8be94c2a5a29b62177d623088ff1b8d0ca2c91998cf394a073bcc67c9aee79b166a63f56e380a1e7d8fa5e7b9fd01cb6b4d43b93cac35cc25c013f6bfd4a6b
|
7
|
+
data.tar.gz: 60472dc8861ef79378dfedd01308d50802b08ce9bbfb971fe6ed1c1e76de5d1dd92a28f22e7f0d50ab5bb732717ed8fdd1299ef946d27126b0d9828e68838231
|
data/.gitignore
CHANGED
data/lib/webtrends/event.rb
CHANGED
data/lib/webtrends/version.rb
CHANGED
data/spec/event_spec.rb
CHANGED
@@ -25,7 +25,7 @@ describe Webtrends::Event do
|
|
25
25
|
expect(response.code).to eq(200)
|
26
26
|
end
|
27
27
|
|
28
|
-
it '
|
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 '
|
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 '
|
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 '
|
56
|
-
context 'not passing
|
57
|
-
it 'uses default
|
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
|
70
|
+
context 'passing custom configuration' do
|
65
71
|
let(:custom_configuration) do
|
66
|
-
|
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
|
73
|
-
it 'does not
|
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.
|
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-
|
16
|
+
date: 2014-02-21 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: bundler
|