schemata-cloud_controller 0.0.1.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/schemata/cloud_controller/droplet_updated_message/droplet_updated_message_v1.rb +35 -0
- data/lib/schemata/cloud_controller/droplet_updated_message.rb +13 -0
- data/lib/schemata/cloud_controller/hm_start_request/hm_start_request_v1.rb +41 -0
- data/lib/schemata/cloud_controller/hm_start_request.rb +13 -0
- data/lib/schemata/cloud_controller/hm_stop_request/hm_stop_request_v1.rb +39 -0
- data/lib/schemata/cloud_controller/hm_stop_request.rb +13 -0
- data/lib/schemata/cloud_controller/version.rb +5 -0
- data/lib/schemata/cloud_controller.rb +19 -0
- data/lib/schemata/common/error.rb +18 -0
- data/lib/schemata/common/msgbase.rb +282 -0
- data/lib/schemata/common/msgtypebase.rb +144 -0
- data/lib/schemata/common/parsed_msg.rb +43 -0
- data/lib/schemata/helpers/hash_copy.rb +28 -0
- data/lib/schemata/helpers/stringify.rb +26 -0
- data/spec/cloud_controller/cloud_controller_spec.rb +6 -0
- data/spec/cloud_controller/droplet_updated_message_spec.rb +10 -0
- data/spec/cloud_controller/hm_start_request_spec.rb +11 -0
- data/spec/cloud_controller/hm_stop_request_spec.rb +12 -0
- data/spec/common/helpers_spec.rb +115 -0
- data/spec/common/parsed_msg_spec.rb +46 -0
- data/spec/component/aux_data_spec.rb +37 -0
- data/spec/component/component_bar_spec.rb +140 -0
- data/spec/component/component_foo_spec.rb +630 -0
- data/spec/component/foo_spec.rb +214 -0
- data/spec/component2/component2_bar_spec.rb +140 -0
- data/spec/dea/advertise_message_spec.rb +10 -0
- data/spec/dea/dea_spec.rb +6 -0
- data/spec/dea/dea_status_response_spec.rb +10 -0
- data/spec/dea/discover_request_spec.rb +10 -0
- data/spec/dea/droplet_status_response_spec.rb +10 -0
- data/spec/dea/exit_message_spec.rb +10 -0
- data/spec/dea/find_droplet_request_spec.rb +27 -0
- data/spec/dea/find_droplet_response_spec.rb +10 -0
- data/spec/dea/heartbeat_response_spec.rb +10 -0
- data/spec/dea/hello_message_spec.rb +10 -0
- data/spec/dea/start_request_spec.rb +10 -0
- data/spec/dea/stop_request_spec.rb +10 -0
- data/spec/dea/update_request_spec.rb +0 -0
- data/spec/health_manager/health_manager_spec.rb +6 -0
- data/spec/health_manager/health_request_spec.rb +12 -0
- data/spec/health_manager/health_response_spec.rb +12 -0
- data/spec/health_manager/status_crashed_response_spec.rb +12 -0
- data/spec/health_manager/status_flapping_response_spec.rb +12 -0
- data/spec/health_manager/status_request_spec.rb +12 -0
- data/spec/router/register_request_spec.rb +10 -0
- data/spec/router/router_spec.rb +6 -0
- data/spec/router/start_message_spec.rb +10 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/staging/staging_message_spec.rb +14 -0
- data/spec/staging/staging_spec.rb +6 -0
- data/spec/support/component_helpers.rb +51 -0
- data/spec/support/helpers.rb +102 -0
- data/spec/support/message_helpers.rb +135 -0
- data/spec/support/message_type_helpers.rb +171 -0
- metadata +220 -0
@@ -0,0 +1,214 @@
|
|
1
|
+
require 'schemata/component/foo'
|
2
|
+
require 'schemata/common/error'
|
3
|
+
require 'support/helpers'
|
4
|
+
|
5
|
+
describe Schemata::Component::Foo do
|
6
|
+
describe "V10" do
|
7
|
+
it "should define accessors for the schema" do
|
8
|
+
v10_obj = Schemata::Component::Foo::V10.new
|
9
|
+
v10_obj.respond_to?(:foo1).should be_true
|
10
|
+
v10_obj.respond_to?(:foo1=).should be_true
|
11
|
+
v10_obj.respond_to?(:foo2).should be_true
|
12
|
+
v10_obj.respond_to?(:foo2=).should be_true
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should not raise an error if an incomplete but valid hash is given" do
|
16
|
+
v10_hash = {"foo1" => "foo"}
|
17
|
+
expect { Schemata::Component::Foo::V10.new(v10_hash) }.to_not raise_error
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should raise an error if an incomplete and invalid hash is given" do
|
21
|
+
v10_hash = {"foo1" => 1}
|
22
|
+
expect {
|
23
|
+
Schemata::Component::Foo::V10.new(v10_hash)
|
24
|
+
}.to raise_error(Schemata::UpdateAttributeError)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should not raise an error if an attribute is correctly assigned" do
|
28
|
+
foo_obj = Schemata::Component.mock_foo 10
|
29
|
+
expect { foo_obj.foo1 = "new name" }.to_not raise_error
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should raise an error if an attribute is incorrectly assigned" do
|
33
|
+
foo_obj = Schemata::Component.mock_foo 10
|
34
|
+
expect { foo_obj.foo1 = 1 }.to raise_error(Schemata::UpdateAttributeError)
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should not raise an error if an incomplete msg_obj is updated \
|
38
|
+
correctly" do
|
39
|
+
v10_hash = {"foo1" => "foo"}
|
40
|
+
v10_obj = Schemata::Component::Foo::V10.new(v10_hash)
|
41
|
+
expect { v10_obj.foo1 = "new name" }.to_not raise_error
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should raise an error if an incomplete msg_obj is updated \
|
45
|
+
incorrectly" do
|
46
|
+
v10_hash = {"foo1" => "foo"}
|
47
|
+
v10_obj = Schemata::Component::Foo::V10.new(v10_hash)
|
48
|
+
expect { v10_obj.foo1 = 1 }.to raise_error(Schemata::UpdateAttributeError)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe "V11" do
|
53
|
+
it "should define accessors for the schema" do
|
54
|
+
v11_obj = Schemata::Component::Foo::V11.new
|
55
|
+
v11_obj.respond_to?(:foo1).should be_true
|
56
|
+
v11_obj.respond_to?(:foo1=).should be_true
|
57
|
+
v11_obj.respond_to?(:foo2).should be_true
|
58
|
+
v11_obj.respond_to?(:foo2=).should be_true
|
59
|
+
v11_obj.respond_to?(:foo3).should be_true
|
60
|
+
v11_obj.respond_to?(:foo3=).should be_true
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should not raise an error if an incomplete but valid hash is given" do
|
64
|
+
v11_hash = {"foo1" => "foo"}
|
65
|
+
expect { Schemata::Component::Foo::V11.new(v11_hash) }.to_not raise_error
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should raise an error if an incomplete and invalid hash is given" do
|
69
|
+
v11_hash = {"foo1" => 1}
|
70
|
+
expect {
|
71
|
+
v11_obj = Schemata::Component::Foo::V11.new(v11_hash)
|
72
|
+
}.to raise_error(Schemata::UpdateAttributeError)
|
73
|
+
end
|
74
|
+
|
75
|
+
it "should not raise an error if an attribute is correctly assigned" do
|
76
|
+
foo_obj = Schemata::Component.mock_foo 11
|
77
|
+
expect { foo_obj.foo2 = 10 }.to_not raise_error
|
78
|
+
end
|
79
|
+
|
80
|
+
it "should raise an error if an attribute is incorrectly assigned" do
|
81
|
+
foo_obj = Schemata::Component.mock_foo 11
|
82
|
+
expect {
|
83
|
+
foo_obj.foo2 = "foo"
|
84
|
+
}.to raise_error(Schemata::UpdateAttributeError)
|
85
|
+
end
|
86
|
+
|
87
|
+
it "should not raise an error if an incomplete msg_obj is updated \
|
88
|
+
correctly" do
|
89
|
+
v11_hash = {"foo1" => "foo"}
|
90
|
+
v11_obj = Schemata::Component::Foo::V11.new(v11_hash)
|
91
|
+
expect { v11_obj.foo1 = "new name" }.to_not raise_error
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should raise an error if an incomplete msg_obj is updated \
|
95
|
+
incorrectly" do
|
96
|
+
v11_hash = {"foo1" => "foo"}
|
97
|
+
v11_obj = Schemata::Component::Foo::V11.new(v11_hash)
|
98
|
+
expect {
|
99
|
+
v11_obj.foo1 = 1
|
100
|
+
}.to raise_error(Schemata::UpdateAttributeError)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
describe "V12" do
|
105
|
+
it "should define accessors for the schema" do
|
106
|
+
v12_obj = Schemata::Component::Foo::V12.new
|
107
|
+
v12_obj.respond_to?(:foo1).should be_true
|
108
|
+
v12_obj.respond_to?(:foo1=).should be_true
|
109
|
+
v12_obj.respond_to?(:foo2).should be_true
|
110
|
+
v12_obj.respond_to?(:foo2=).should be_true
|
111
|
+
v12_obj.respond_to?(:foo3).should be_true
|
112
|
+
v12_obj.respond_to?(:foo3=).should be_true
|
113
|
+
end
|
114
|
+
|
115
|
+
it "should not raise an error if an incomplete but valid hash is given" do
|
116
|
+
v12_hash = {"foo1" => "foo"}
|
117
|
+
expect { Schemata::Component::Foo::V12.new(v12_hash) }.to_not raise_error
|
118
|
+
end
|
119
|
+
|
120
|
+
it "should raise an error if an incomplete and invalid hash is given" do
|
121
|
+
v12_hash = {"foo1" => 1}
|
122
|
+
expect {
|
123
|
+
Schemata::Component::Foo::V12.new(v12_hash)
|
124
|
+
}.to raise_error(Schemata::UpdateAttributeError)
|
125
|
+
end
|
126
|
+
|
127
|
+
it "should not raise an error if an attribute is correctly assigned" do
|
128
|
+
foo_obj = Schemata::Component.mock_foo 12
|
129
|
+
expect { foo_obj.foo3 = [1, 2] }.to_not raise_error
|
130
|
+
end
|
131
|
+
|
132
|
+
it "should raise an error if an attribute is incorrectly assigned" do
|
133
|
+
foo_obj = Schemata::Component.mock_foo 12
|
134
|
+
expect {
|
135
|
+
foo_obj.foo3 = 1
|
136
|
+
}.to raise_error(Schemata::UpdateAttributeError)
|
137
|
+
end
|
138
|
+
|
139
|
+
it "should not raise an error if an incomplete msg_obj is updated \
|
140
|
+
correctly" do
|
141
|
+
v12_hash = {"foo1" => "foo"}
|
142
|
+
v12_obj = Schemata::Component::Foo::V12.new(v12_hash)
|
143
|
+
expect { v12_obj.foo1 = "new name" }.to_not raise_error
|
144
|
+
end
|
145
|
+
|
146
|
+
it "should raise an error if an incomplete msg_obj is updated \
|
147
|
+
incorrectly" do
|
148
|
+
v12_hash = {"foo1" => "foo"}
|
149
|
+
v12_obj = Schemata::Component::Foo::V12.new(v12_hash)
|
150
|
+
expect {
|
151
|
+
v12_obj.foo1 = 1
|
152
|
+
}.to raise_error(Schemata::UpdateAttributeError)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
describe "V13" do
|
157
|
+
it "should define accessors for the schema" do
|
158
|
+
v13_obj = Schemata::Component::Foo::V13.new
|
159
|
+
v13_obj.respond_to?(:foo1).should be_true
|
160
|
+
v13_obj.respond_to?(:foo1=).should be_true
|
161
|
+
v13_obj.respond_to?(:foo3).should be_true
|
162
|
+
v13_obj.respond_to?(:foo3=).should be_true
|
163
|
+
v13_obj.respond_to?(:foo4).should be_true
|
164
|
+
v13_obj.respond_to?(:foo4=).should be_true
|
165
|
+
end
|
166
|
+
|
167
|
+
it "should not raise an error if an incomplete but valid hash is given" do
|
168
|
+
v13_hash = {"foo1" => "foo"}
|
169
|
+
expect { Schemata::Component::Foo::V13.new(v13_hash) }.to_not raise_error
|
170
|
+
end
|
171
|
+
|
172
|
+
it "should raise an error if an incomplete and invalid hash is given" do
|
173
|
+
v13_hash = {"foo1" => 1}
|
174
|
+
expect {
|
175
|
+
Schemata::Component::Foo::V13.new(v13_hash)
|
176
|
+
}.to raise_error(Schemata::UpdateAttributeError)
|
177
|
+
end
|
178
|
+
|
179
|
+
it "should not raise an error if an attribute is correctly assigned" do
|
180
|
+
foo_obj = Schemata::Component.mock_foo 13
|
181
|
+
expect { foo_obj.foo4 = "foobar" }.to_not raise_error
|
182
|
+
end
|
183
|
+
|
184
|
+
it "should raise an error if an attribute is incorrectly assigned" do
|
185
|
+
foo_obj = Schemata::Component.mock_foo 13
|
186
|
+
expect {
|
187
|
+
foo_obj.foo4 =1
|
188
|
+
}.to raise_error(Schemata::UpdateAttributeError)
|
189
|
+
end
|
190
|
+
|
191
|
+
it "should raise an error if an accessed field was removed" do
|
192
|
+
foo_obj = Schemata::Component.mock_foo 13
|
193
|
+
expect {
|
194
|
+
foo_obj.foo2
|
195
|
+
}.to raise_error
|
196
|
+
end
|
197
|
+
|
198
|
+
it "should not raise an error if an incomplete msg_obj is updated \
|
199
|
+
correctly" do
|
200
|
+
v13_hash = {"foo1" => "foo"}
|
201
|
+
v13_obj = Schemata::Component::Foo::V13.new(v13_hash)
|
202
|
+
expect { v13_obj.foo1 = "new name" }.to_not raise_error
|
203
|
+
end
|
204
|
+
|
205
|
+
it "should raise an error if an incomplete msg_obj is updated \
|
206
|
+
incorrectly" do
|
207
|
+
v13_hash = {"foo1" => "foo"}
|
208
|
+
v13_obj = Schemata::Component::Foo::V13.new(v13_hash)
|
209
|
+
expect {
|
210
|
+
v13_obj.foo1 = 1
|
211
|
+
}.to raise_error(Schemata::UpdateAttributeError)
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
@@ -0,0 +1,140 @@
|
|
1
|
+
require 'schemata/component2/component2'
|
2
|
+
require 'support/helpers'
|
3
|
+
|
4
|
+
describe Schemata::Component2 do
|
5
|
+
before :each do
|
6
|
+
@v10_msg = '{
|
7
|
+
"min_version": 10,
|
8
|
+
"V10": {
|
9
|
+
"bar1": "first",
|
10
|
+
"bar2": "second"
|
11
|
+
}
|
12
|
+
}'
|
13
|
+
|
14
|
+
@v11_msg = '{
|
15
|
+
"min_version": 10,
|
16
|
+
"V11": {
|
17
|
+
"bar1": 1,
|
18
|
+
"bar3": "third"
|
19
|
+
},
|
20
|
+
"V10": {
|
21
|
+
"bar1": "1",
|
22
|
+
"bar2": "second"
|
23
|
+
}
|
24
|
+
}'
|
25
|
+
|
26
|
+
@v10_hash = {
|
27
|
+
"bar1" => "1",
|
28
|
+
"bar2" => "second"
|
29
|
+
}
|
30
|
+
|
31
|
+
@v11_hash = {
|
32
|
+
"bar1" => 1,
|
33
|
+
"bar3" => "third"
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
describe "#decode" do
|
38
|
+
describe "(current version is 10)" do
|
39
|
+
before :each do
|
40
|
+
set_current_version(Schemata::Component2::Bar, 10)
|
41
|
+
end
|
42
|
+
|
43
|
+
after :each do
|
44
|
+
reset_version(Schemata::Component2::Bar)
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should take a v10 msg and create a v10 obj" do
|
48
|
+
msg_obj = Schemata::Component2::Bar.decode(@v10_msg)
|
49
|
+
msg_obj.bar1.should == "first"
|
50
|
+
msg_obj.bar2.should == "second"
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should take a v11 msg and create a v10 obj" do
|
54
|
+
msg_obj = Schemata::Component2::Bar.decode(@v11_msg)
|
55
|
+
msg_obj.bar1.should == "1"
|
56
|
+
msg_obj.bar2.should == "second"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe "(current version is 11)" do
|
61
|
+
before :each do
|
62
|
+
set_current_version(Schemata::Component2::Bar, 11)
|
63
|
+
end
|
64
|
+
|
65
|
+
after :each do
|
66
|
+
reset_version(Schemata::Component2::Bar)
|
67
|
+
end
|
68
|
+
|
69
|
+
it "should take a v10 msg and create a v11 obj" do
|
70
|
+
msg_obj = Schemata::Component2::Bar.decode(@v10_msg)
|
71
|
+
msg_obj.bar1.should == 5
|
72
|
+
msg_obj.bar3.should == "third"
|
73
|
+
end
|
74
|
+
|
75
|
+
it "should take a v11 msg and create a v11 obj" do
|
76
|
+
msg_obj = Schemata::Component2::Bar.decode(@v11_msg)
|
77
|
+
msg_obj.bar1.should == 1
|
78
|
+
msg_obj.bar3.should == "third"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
describe "#encode" do
|
84
|
+
describe "(current version is 10)" do
|
85
|
+
before :each do
|
86
|
+
set_current_version(Schemata::Component2::Bar, 10)
|
87
|
+
end
|
88
|
+
|
89
|
+
after :each do
|
90
|
+
reset_version(Schemata::Component2::Bar)
|
91
|
+
end
|
92
|
+
|
93
|
+
it "should take a v10 obj and encode a json msg" do
|
94
|
+
v10_obj = Schemata::Component2::Bar::V10.new(@v10_hash)
|
95
|
+
json_msg = v10_obj.encode
|
96
|
+
returned_hash = Yajl::Parser.parse(json_msg)
|
97
|
+
|
98
|
+
returned_hash.keys.should =~ ['min_version', 'V10']
|
99
|
+
returned_hash['min_version'].should ==
|
100
|
+
@curr_class::MIN_VERSION_ALLOWED
|
101
|
+
|
102
|
+
v10 = returned_hash['V10']
|
103
|
+
v10.each do |k, v|
|
104
|
+
v10[k].should == @v10_hash[k]
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
describe "(current version is 11)" do
|
110
|
+
before :each do
|
111
|
+
set_current_version(Schemata::Component2::Bar, 11)
|
112
|
+
end
|
113
|
+
|
114
|
+
it "should take a v11 obj and encode a json msg" do
|
115
|
+
aux_data = {"bar2" => "second" }
|
116
|
+
v11_obj = Schemata::Component2::Bar::V11.new(@v11_hash, aux_data)
|
117
|
+
json_msg = v11_obj.encode
|
118
|
+
returned_hash = Yajl::Parser.parse(json_msg)
|
119
|
+
|
120
|
+
returned_hash.keys.should =~ ['min_version', 'V10', 'V11']
|
121
|
+
returned_hash['min_version'].should ==
|
122
|
+
@curr_class::MIN_VERSION_ALLOWED
|
123
|
+
|
124
|
+
v10 = returned_hash['V10']
|
125
|
+
v10.each do |k, v|
|
126
|
+
v10[k].should == @v10_hash[k]
|
127
|
+
end
|
128
|
+
|
129
|
+
v11 = returned_hash['V11']
|
130
|
+
v11.each do |k, v|
|
131
|
+
v11[k].should == @v11_hash[k]
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
after :each do
|
136
|
+
reset_version(Schemata::Component2::Bar)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'schemata/dea'
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Schemata::DEA::FindDropletRequest do
|
5
|
+
it_behaves_like "a message type"
|
6
|
+
end
|
7
|
+
|
8
|
+
describe Schemata::DEA::FindDropletRequest::V1 do
|
9
|
+
it_behaves_like "a message"
|
10
|
+
|
11
|
+
it "should stringify the 'states' field when it is given to the constructor as a symbol" do
|
12
|
+
hash = {
|
13
|
+
"droplet" => "deadbeef",
|
14
|
+
"states" => [:RUNNING],
|
15
|
+
"version" => "0.1.0",
|
16
|
+
}
|
17
|
+
|
18
|
+
msg_obj = Schemata::DEA::FindDropletRequest::V1.new(hash)
|
19
|
+
msg_obj.states.should =~ ["RUNNING"]
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should stringify the 'states' field when a symbold is passed ot the attr writer" do
|
23
|
+
msg_obj = Schemata::DEA.mock_find_droplet_request
|
24
|
+
msg_obj.states = [:RUNNING]
|
25
|
+
msg_obj.states.should =~ ["RUNNING"]
|
26
|
+
end
|
27
|
+
end
|
File without changes
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'schemata/health_manager'
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Schemata::HealthManager::HealthRequest do
|
5
|
+
it_behaves_like "a message type"
|
6
|
+
end
|
7
|
+
|
8
|
+
Schemata::HealthManager::HealthRequest.versions.each do |v|
|
9
|
+
describe Schemata::HealthManager::HealthRequest::const_get("V#{v}") do
|
10
|
+
it_behaves_like "a message"
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'schemata/health_manager'
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Schemata::HealthManager::HealthResponse do
|
5
|
+
it_behaves_like "a message type"
|
6
|
+
end
|
7
|
+
|
8
|
+
Schemata::HealthManager::HealthResponse.versions.each do |v|
|
9
|
+
describe Schemata::HealthManager::HealthResponse::const_get("V#{v}") do
|
10
|
+
it_behaves_like "a message"
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'schemata/health_manager'
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Schemata::HealthManager::StatusCrashedResponse do
|
5
|
+
it_behaves_like "a message type"
|
6
|
+
end
|
7
|
+
|
8
|
+
Schemata::HealthManager::StatusCrashedResponse.versions.each do |v|
|
9
|
+
describe Schemata::HealthManager::StatusCrashedResponse::const_get("V#{v}") do
|
10
|
+
it_behaves_like "a message"
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'schemata/health_manager'
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Schemata::HealthManager::StatusFlappingResponse do
|
5
|
+
it_behaves_like "a message type"
|
6
|
+
end
|
7
|
+
|
8
|
+
Schemata::HealthManager::StatusFlappingResponse.versions.each do |v|
|
9
|
+
describe Schemata::HealthManager::StatusFlappingResponse::const_get("V#{v}") do
|
10
|
+
it_behaves_like "a message"
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'schemata/health_manager'
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Schemata::HealthManager::StatusRequest do
|
5
|
+
it_behaves_like "a message type"
|
6
|
+
end
|
7
|
+
|
8
|
+
Schemata::HealthManager::StatusRequest.versions.each do |v|
|
9
|
+
describe Schemata::HealthManager::StatusRequest::const_get("V#{v}") do
|
10
|
+
it_behaves_like "a message"
|
11
|
+
end
|
12
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Dir["./spec/support/**/*.rb"].sort.each { |f| require f }
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'schemata/staging'
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Schemata::Staging::Message do
|
5
|
+
it_behaves_like "a message type"
|
6
|
+
end
|
7
|
+
|
8
|
+
describe Schemata::Staging::Message::V1 do
|
9
|
+
it_behaves_like "a message"
|
10
|
+
end
|
11
|
+
|
12
|
+
describe Schemata::Staging::Message::V2 do
|
13
|
+
it_behaves_like "a message"
|
14
|
+
end
|