cpi-event-connector 0.4.0 → 0.4.1
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.
- data/Gemfile.lock +4 -2
- data/lib/cpi/event.rb +3 -1
- data/lib/cpi/version.rb +1 -1
- data/spec/event_connector_spec.rb +4 -3
- data/spec/event_spec.rb +18 -0
- metadata +2 -2
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cpi-event-connector (0.
|
4
|
+
cpi-event-connector (0.4.0)
|
5
5
|
activesupport (~> 3.0)
|
6
6
|
bunny (~> 0.8.0)
|
7
7
|
nokogiri (~> 1.5)
|
@@ -17,8 +17,10 @@ GEM
|
|
17
17
|
diff-lcs (1.1.3)
|
18
18
|
i18n (0.6.1)
|
19
19
|
justinf-unification_assertion (0.0.2)
|
20
|
+
mini_portile (0.5.0)
|
20
21
|
multi_json (1.7.6)
|
21
|
-
nokogiri (1.
|
22
|
+
nokogiri (1.6.0)
|
23
|
+
mini_portile (~> 0.5.0)
|
22
24
|
rspec (2.8.0)
|
23
25
|
rspec-core (~> 2.8.0)
|
24
26
|
rspec-expectations (~> 2.8.0)
|
data/lib/cpi/event.rb
CHANGED
data/lib/cpi/version.rb
CHANGED
@@ -94,8 +94,9 @@ describe Cpi::EventConnector do
|
|
94
94
|
</header>
|
95
95
|
<content>some content</content>
|
96
96
|
</cpi_event>
|
97
|
-
|
98
|
-
|
97
|
+
XML
|
98
|
+
|
99
|
+
h.should unify({"event_type" => "type", "tenant" => "tenant_uid", "content" => xml, "uid" => 'unique_id'})
|
99
100
|
end
|
100
101
|
|
101
102
|
it "send_event works when given xml" do
|
@@ -112,7 +113,7 @@ describe Cpi::EventConnector do
|
|
112
113
|
Cpi::EventConnector.send_event(xml, :queue => 'system_queue_name')
|
113
114
|
|
114
115
|
h = get_event_from_rabbimq("system_queue_name")
|
115
|
-
h.should unify({"event_type" => "type", "tenant" => "tenant_uid", "content" => xml, "uid" => 'unique_id'})
|
116
|
+
h.should unify({"event_type" => "type", "tenant" => "tenant_uid", "content" => xml.strip, "uid" => 'unique_id'})
|
116
117
|
end
|
117
118
|
end
|
118
119
|
|
data/spec/event_spec.rb
CHANGED
@@ -48,6 +48,24 @@ describe Cpi::Event do
|
|
48
48
|
<source_tenant_uid>tenant_uid</source_tenant_uid>
|
49
49
|
</header>
|
50
50
|
<content>some content</content>
|
51
|
+
</cpi_event>
|
52
|
+
XML
|
53
|
+
event.xml.should == xml.strip
|
54
|
+
end
|
55
|
+
|
56
|
+
it "uses nokogiri xml as content" do
|
57
|
+
event = Cpi::Event.new(event_type: 'type', source_tenant_uid: 'tenant_uid', event_uid: 'uid', content: "<test>test</test>")
|
58
|
+
|
59
|
+
xml = <<-XML
|
60
|
+
<cpi_event>
|
61
|
+
<header>
|
62
|
+
<event_uid>uid</event_uid>
|
63
|
+
<event_type>type</event_type>
|
64
|
+
<source_tenant_uid>tenant_uid</source_tenant_uid>
|
65
|
+
</header>
|
66
|
+
<content>
|
67
|
+
<test>test</test>
|
68
|
+
</content>
|
51
69
|
</cpi_event>
|
52
70
|
XML
|
53
71
|
event.xml.should == xml.strip
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cpi-event-connector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|