nofxx-nanite 0.4.1.2 → 0.4.1.15
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -2
- data/bin/nanite-agent +3 -0
- data/lib/nanite.rb +8 -2
- data/lib/nanite/agent.rb +19 -11
- data/lib/nanite/amqp.rb +18 -1
- data/lib/nanite/cluster.rb +34 -14
- data/lib/nanite/config.rb +1 -1
- data/lib/nanite/daemonize.rb +4 -4
- data/lib/nanite/local_state.rb +4 -0
- data/lib/nanite/log.rb +1 -1
- data/lib/nanite/mapper.rb +34 -21
- data/lib/nanite/mapper_proxy.rb +4 -4
- data/lib/nanite/{dispatcher.rb → nanite_dispatcher.rb} +1 -1
- data/lib/nanite/packets.rb +4 -2
- data/lib/nanite/reaper.rb +15 -14
- data/lib/nanite/security/signature.rb +1 -1
- data/lib/nanite/serializer.rb +31 -18
- data/lib/nanite/state.rb +7 -3
- metadata +63 -59
- data/spec/actor_registry_spec.rb +0 -60
- data/spec/actor_spec.rb +0 -77
- data/spec/agent_spec.rb +0 -240
- data/spec/cached_certificate_store_proxy_spec.rb +0 -34
- data/spec/certificate_cache_spec.rb +0 -49
- data/spec/certificate_spec.rb +0 -27
- data/spec/cluster_spec.rb +0 -485
- data/spec/dispatcher_spec.rb +0 -136
- data/spec/distinguished_name_spec.rb +0 -24
- data/spec/encrypted_document_spec.rb +0 -21
- data/spec/job_spec.rb +0 -251
- data/spec/local_state_spec.rb +0 -112
- data/spec/packet_spec.rb +0 -220
- data/spec/rsa_key_pair_spec.rb +0 -33
- data/spec/secure_serializer_spec.rb +0 -41
- data/spec/serializer_spec.rb +0 -107
- data/spec/signature_spec.rb +0 -30
- data/spec/spec_helper.rb +0 -33
- data/spec/static_certificate_store_spec.rb +0 -30
- data/spec/util_spec.rb +0 -63
@@ -1,30 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), 'spec_helper')
|
2
|
-
|
3
|
-
describe Nanite::StaticCertificateStore do
|
4
|
-
|
5
|
-
include SpecHelpers
|
6
|
-
|
7
|
-
before(:all) do
|
8
|
-
@signer, key = issue_cert
|
9
|
-
@recipient, key = issue_cert
|
10
|
-
@cert, @key = issue_cert
|
11
|
-
@store = Nanite::StaticCertificateStore.new(@signer, @recipient)
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'should not raise when passed nil objects' do
|
15
|
-
res = nil
|
16
|
-
lambda { res = @store.get_signer(nil) }.should_not raise_error
|
17
|
-
res.should == [ @signer ]
|
18
|
-
lambda { res = @store.get_recipients(nil) }.should_not raise_error
|
19
|
-
res.should == [ @recipient ]
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'should return signer certificates' do
|
23
|
-
@store.get_signer('anything').should == [ @signer ]
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'should return recipient certificates' do
|
27
|
-
@store.get_recipients('anything').should == [ @recipient ]
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
data/spec/util_spec.rb
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), 'spec_helper')
|
2
|
-
|
3
|
-
describe String do
|
4
|
-
|
5
|
-
describe ".snake_case" do
|
6
|
-
|
7
|
-
it "should downcase single word" do
|
8
|
-
["FOO", "Foo", "foo"].each do |w|
|
9
|
-
w.snake_case.should == "foo"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should not separate numbers from end of word" do
|
14
|
-
["Foo1234", "foo1234"].each do |w|
|
15
|
-
w.snake_case.should == "foo1234"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should separate numbers from word it starts with uppercase letter" do
|
20
|
-
"1234Foo".snake_case.should == "1234_foo"
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should not separate numbers from word starts with lowercase letter" do
|
24
|
-
"1234foo".snake_case.should == "1234foo"
|
25
|
-
end
|
26
|
-
|
27
|
-
it "should downcase camel-cased words and connect with underscore" do
|
28
|
-
["FooBar", "fooBar"].each do |w|
|
29
|
-
w.snake_case.should == "foo_bar"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should start new word with uppercase letter before lower case letter" do
|
34
|
-
["FooBARBaz", "fooBARBaz"].each do |w|
|
35
|
-
w.snake_case.should == "foo_bar_baz"
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
describe ".to_const_path" do
|
42
|
-
|
43
|
-
it "should snake-case the string" do
|
44
|
-
str = "hello"
|
45
|
-
str.should_receive(:snake_case).and_return("snake-cased hello")
|
46
|
-
str.to_const_path
|
47
|
-
end
|
48
|
-
|
49
|
-
it "should leave (snake-cased) string without '::' unchanged" do
|
50
|
-
"hello".to_const_path.should == "hello"
|
51
|
-
end
|
52
|
-
|
53
|
-
it "should replace single '::' with '/'" do
|
54
|
-
"hello::world".to_const_path.should == "hello/world"
|
55
|
-
end
|
56
|
-
|
57
|
-
it "should replace multiple '::' with '/'" do
|
58
|
-
"hello::nanite::world".to_const_path.should == "hello/nanite/world"
|
59
|
-
end
|
60
|
-
|
61
|
-
end
|
62
|
-
|
63
|
-
end # String
|