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.
@@ -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