xommelier 0.1.30 → 0.1.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +1 -0
- data/config/giteaucrat.yml +5 -0
- data/lib/xommelier/atom/category.rb +7 -0
- data/lib/xommelier/atom/content.rb +7 -0
- data/lib/xommelier/atom/entry.rb +7 -0
- data/lib/xommelier/atom/feed.rb +7 -0
- data/lib/xommelier/atom/full.rb +7 -0
- data/lib/xommelier/atom/generator.rb +7 -0
- data/lib/xommelier/atom/history.rb +7 -0
- data/lib/xommelier/atom/link.rb +7 -0
- data/lib/xommelier/atom/links_extension.rb +7 -0
- data/lib/xommelier/atom/person.rb +7 -0
- data/lib/xommelier/atom/source.rb +7 -0
- data/lib/xommelier/atom/threading.rb +7 -0
- data/lib/xommelier/atom.rb +7 -0
- data/lib/xommelier/common.rb +7 -0
- data/lib/xommelier/core_ext/boolean.rb +8 -0
- data/lib/xommelier/core_ext/date.rb +7 -0
- data/lib/xommelier/core_ext/float.rb +7 -0
- data/lib/xommelier/core_ext/numeric.rb +7 -0
- data/lib/xommelier/core_ext/string.rb +7 -0
- data/lib/xommelier/core_ext/symbol.rb +7 -0
- data/lib/xommelier/core_ext/time.rb +7 -0
- data/lib/xommelier/core_ext/uri.rb +8 -0
- data/lib/xommelier/core_ext.rb +7 -0
- data/lib/xommelier/ds.rb +266 -0
- data/lib/xommelier/dsig11.rb +111 -0
- data/lib/xommelier/factory_girl.rb +24 -0
- data/lib/xommelier/open_search.rb +7 -0
- data/lib/xommelier/opml.rb +7 -0
- data/lib/xommelier/rss/atomic.rb +7 -0
- data/lib/xommelier/rss.rb +7 -0
- data/lib/xommelier/schemas/ds.xsd +318 -0
- data/lib/xommelier/schemas/dsig11.xsd +131 -0
- data/lib/xommelier/schemas/xmldsig1-schema.xsd +11 -0
- data/lib/xommelier/sitemap.rb +7 -0
- data/lib/xommelier/version.rb +8 -1
- data/lib/xommelier/xml/element/namespace.rb +7 -0
- data/lib/xommelier/xml/element/serialization.rb +7 -0
- data/lib/xommelier/xml/element/structure/property.rb +7 -0
- data/lib/xommelier/xml/element/structure.rb +7 -0
- data/lib/xommelier/xml/element.rb +7 -0
- data/lib/xommelier/xml/namespace.rb +8 -0
- data/lib/xommelier/xml/schema.rb +7 -0
- data/lib/xommelier/xml.rb +7 -0
- data/lib/xommelier.rb +9 -0
- data/spec/fixtures/ds_rsa.xml +58 -0
- data/spec/fixtures/nested_atom.xml +2 -6
- data/spec/functional/xommelier/atom/feed/building_hash_spec.rb +10 -4
- data/spec/functional/xommelier/atom/feed/building_spec.rb +7 -0
- data/spec/functional/xommelier/atom/feed/parsing_spec.rb +9 -7
- data/spec/functional/xommelier/atom/threading/building_spec.rb +7 -0
- data/spec/functional/xommelier/open_search/description/building_spec.rb +7 -0
- data/spec/functional/xommelier/open_search/description/parsing_spec.rb +7 -3
- data/spec/functional/xommelier/rss/rss/building_spec.rb +7 -0
- data/spec/functional/xommelier/rss/rss/parsing_spec.rb +8 -5
- data/spec/lib/xommelier/atom/entry_spec.rb +7 -0
- data/spec/lib/xommelier/ds_spec.rb +102 -0
- data/spec/lib/xommelier/rss/email_address_spec.rb +7 -0
- data/spec/lib/xommelier/xml/element/serialization_spec.rb +7 -0
- data/spec/lib/xommelier/xml/element/structure_spec.rb +7 -0
- data/spec/lib/xommelier/xml/element_spec.rb +7 -0
- data/spec/lib/xommelier/xml_spec.rb +7 -0
- data/spec/lib/xommelier_spec.rb +7 -0
- data/spec/namespaced_module.rb +7 -0
- data/spec/spec_helper.rb +7 -0
- data/spec/support/fixtures.rb +7 -0
- data/spec/support/schema_validatable.rb +7 -0
- data/xommelier.gemspec +1 -0
- metadata +32 -27
data/lib/xommelier.rb
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
require 'xommelier/version'
|
2
9
|
require 'xommelier/core_ext'
|
3
10
|
require 'active_support/dependencies/autoload'
|
@@ -6,6 +13,7 @@ module Xommelier
|
|
6
13
|
extend ActiveSupport::Autoload
|
7
14
|
|
8
15
|
autoload :Atom
|
16
|
+
autoload :DS, 'xommelier/ds'
|
9
17
|
autoload :OpenSearch
|
10
18
|
autoload :OPML, 'xommelier/opml'
|
11
19
|
autoload :RSS, 'xommelier/rss'
|
@@ -31,3 +39,4 @@ module Xommelier
|
|
31
39
|
end
|
32
40
|
|
33
41
|
require 'xommelier/xml'
|
42
|
+
require 'xommelier/factory_girl' if defined?(FactoryGirl)
|
@@ -0,0 +1,58 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
|
3
|
+
<SignedInfo>
|
4
|
+
<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
|
5
|
+
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
|
6
|
+
<Reference URI="http://www.w3.org/TR/xml-stylesheet">
|
7
|
+
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
|
8
|
+
<DigestValue>60NvZvtdTB+7UnlLp/H24p7h4bs=</DigestValue>
|
9
|
+
</Reference>
|
10
|
+
</SignedInfo>
|
11
|
+
<SignatureValue>
|
12
|
+
juS5RhJ884qoFR8flVXd/rbrSDVGn40CapgB7qeQiT+rr0NekEQ6BHhUA8dT3+BC
|
13
|
+
TBUQI0dBjlml9lwzENXvS83zRECjzXbMRTUtVZiPZG2pqKPnL2YU3A9645UCjTXU
|
14
|
+
+jgFumv7k78hieAGDzNci+PQ9KRmm//icT7JaYztgt4=
|
15
|
+
</SignatureValue>
|
16
|
+
<KeyInfo>
|
17
|
+
<KeyValue>
|
18
|
+
<RSAKeyValue>
|
19
|
+
<Modulus>
|
20
|
+
uCiukpgOaOmrq1fPUTH3CAXxuFmPjsmS4jnTKxrv0w1JKcXtJ2M3akaV1d/karvJ
|
21
|
+
lmeao20jNy9r+/vKwibjM77F+3bIkeMEGmAIUnFciJkR+ihO7b4cTuYnEi8xHtu4
|
22
|
+
iMn6GODBoEzqFQYdd8p4vrZBsvs44nTrS8qyyhba648=
|
23
|
+
</Modulus>
|
24
|
+
<Exponent>
|
25
|
+
AQAB
|
26
|
+
</Exponent>
|
27
|
+
</RSAKeyValue>
|
28
|
+
</KeyValue>
|
29
|
+
<X509Data>
|
30
|
+
<X509SubjectName>
|
31
|
+
CN=Merlin Hughes,O=Baltimore Technologies\, Ltd.,ST=Dublin,C=IE
|
32
|
+
</X509SubjectName>
|
33
|
+
<X509IssuerSerial>
|
34
|
+
<X509IssuerName>
|
35
|
+
CN=Test RSA CA,O=Baltimore Technologies\, Ltd.,ST=Dublin,C=IE
|
36
|
+
</X509IssuerName>
|
37
|
+
<X509SerialNumber>970849928</X509SerialNumber>
|
38
|
+
</X509IssuerSerial>
|
39
|
+
<X509Certificate>
|
40
|
+
MIICeDCCAeGgAwIBAgIEOd3+iDANBgkqhkiG9w0BAQQFADBbMQswCQYDVQQGEwJJ
|
41
|
+
RTEPMA0GA1UECBMGRHVibGluMSUwIwYDVQQKExxCYWx0aW1vcmUgVGVjaG5vbG9n
|
42
|
+
aWVzLCBMdGQuMRQwEgYDVQQDEwtUZXN0IFJTQSBDQTAeFw0wMDEwMDYxNjMyMDda
|
43
|
+
Fw0wMTEwMDYxNjMyMDRaMF0xCzAJBgNVBAYTAklFMQ8wDQYDVQQIEwZEdWJsaW4x
|
44
|
+
JTAjBgNVBAoTHEJhbHRpbW9yZSBUZWNobm9sb2dpZXMsIEx0ZC4xFjAUBgNVBAMT
|
45
|
+
DU1lcmxpbiBIdWdoZXMwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALgorpKY
|
46
|
+
Dmjpq6tXz1Ex9wgF8bhZj47JkuI50ysa79MNSSnF7SdjN2pGldXf5Gq7yZZnmqNt
|
47
|
+
Izcva/v7ysIm4zO+xft2yJHjBBpgCFJxXIiZEfooTu2+HE7mJxIvMR7buIjJ+hjg
|
48
|
+
waBM6hUGHXfKeL62QbL7OOJ060vKssoW2uuPAgMBAAGjRzBFMB4GA1UdEQQXMBWB
|
49
|
+
E21lcmxpbkBiYWx0aW1vcmUuaWUwDgYDVR0PAQH/BAQDAgeAMBMGA1UdIwQMMAqA
|
50
|
+
CEngrZIVgu03MA0GCSqGSIb3DQEBBAUAA4GBAHJu4JVq/WnXK2oqqfLWqes5vHOt
|
51
|
+
fX/ZhCjFyDMhzslI8am62gZedwZ9IIZIwlNRMvEDQB2zds/eEBnIAQPl/yRLCLOf
|
52
|
+
ZnbA8PXrbFP5igs3qQWScBUjZVjik748HU2sUVZOa90c0mJl2vJs/RwyLW7/uCAf
|
53
|
+
C/I/k9xGr7fneoIW
|
54
|
+
</X509Certificate>
|
55
|
+
</X509Data>
|
56
|
+
</KeyInfo>
|
57
|
+
</Signature>
|
58
|
+
|
@@ -12,12 +12,8 @@
|
|
12
12
|
<email>sevenov@gmail.com</email>
|
13
13
|
</contributor>
|
14
14
|
<contributor>
|
15
|
-
<name>
|
16
|
-
<email>
|
17
|
-
</contributor>
|
18
|
-
<contributor>
|
19
|
-
<name>Pyotr</name>
|
20
|
-
<email>pyotr@example.com</email>
|
15
|
+
<name>Sergey</name>
|
16
|
+
<email>sergey@ukstv.me</email>
|
21
17
|
</contributor>
|
22
18
|
<entry>
|
23
19
|
<title>First article</title>
|
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
require 'spec_helper'
|
2
9
|
|
3
10
|
describe Xommelier::Atom::Feed do
|
@@ -10,8 +17,7 @@ describe Xommelier::Atom::Feed do
|
|
10
17
|
updated: Time.utc(2012, 04, 04, 04, 04),
|
11
18
|
contributors: [
|
12
19
|
{name: 'Artyom', email: 'sevenov@gmail.com'},
|
13
|
-
{name: '
|
14
|
-
{name: 'Pyotr', email: 'pyotr@example.com'},
|
20
|
+
{name: 'Sergey', email: 'sergey@ukstv.me'},
|
15
21
|
],
|
16
22
|
entries: [
|
17
23
|
{title: 'First article', updated: Time.utc(2012, 01, 01, 01, 01)},
|
@@ -24,11 +30,11 @@ describe Xommelier::Atom::Feed do
|
|
24
30
|
subject(:doc) { Xommelier::Atom::Feed.new(hash) }
|
25
31
|
|
26
32
|
it { should have(1).authors }
|
27
|
-
it { should have(
|
33
|
+
it { should have(2).contributors }
|
28
34
|
it { should have(3).entries }
|
29
35
|
|
30
36
|
it { doc.author.should be_an(Xommelier::Atom::Person) }
|
31
|
-
it { doc.contributors[
|
37
|
+
it { doc.contributors[1].should be_an(Xommelier::Atom::Person) }
|
32
38
|
it { doc.entries[1].should be_an(Xommelier::Atom::Entry) }
|
33
39
|
|
34
40
|
its(:to_hash) { should == hash}
|
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
require 'spec_helper'
|
2
9
|
|
3
10
|
describe Xommelier::Atom::Feed do
|
@@ -1,4 +1,10 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
2
8
|
require 'spec_helper'
|
3
9
|
require 'active_support/core_ext/numeric/time'
|
4
10
|
require 'xommelier/atom/full'
|
@@ -6,9 +12,7 @@ require 'xommelier/atom/full'
|
|
6
12
|
describe Xommelier::Atom::Feed do
|
7
13
|
describe '.parse' do
|
8
14
|
let(:atom_xml) { load_xml_file('feed.atom') }
|
9
|
-
|
10
|
-
|
11
|
-
subject { feed }
|
15
|
+
subject(:feed) { Xommelier::Atom::Feed.parse(atom_xml) }
|
12
16
|
|
13
17
|
it { should be_kind_of(Xommelier::Atom::Feed) }
|
14
18
|
it { should respond_to(:complete?) }
|
@@ -50,8 +54,7 @@ describe Xommelier::Atom::Feed do
|
|
50
54
|
|
51
55
|
it { feed.should have(2).entries }
|
52
56
|
describe 'Entry' do
|
53
|
-
|
54
|
-
subject { entry }
|
57
|
+
subject(:entry) { feed.entries[0] }
|
55
58
|
|
56
59
|
its(:id) { should == 'urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a' }
|
57
60
|
its(:title) { should == 'Atom-Powered Robots Run Amok' }
|
@@ -102,8 +105,7 @@ describe Xommelier::Atom::Feed do
|
|
102
105
|
its(:total) { should == 1 }
|
103
106
|
|
104
107
|
describe 'Comment' do
|
105
|
-
|
106
|
-
subject { comment }
|
108
|
+
subject(:comment) { feed.entries[1] }
|
107
109
|
|
108
110
|
its(:id) { should == 'urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6b' }
|
109
111
|
its(:title) { should == 'First comment' }
|
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
require 'spec_helper'
|
2
9
|
require 'xommelier/atom/full'
|
3
10
|
|
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
require 'spec_helper'
|
2
9
|
|
3
10
|
describe Xommelier::OpenSearch::Description do
|
@@ -1,13 +1,17 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
2
8
|
require 'spec_helper'
|
3
9
|
require 'xommelier/open_search'
|
4
10
|
|
5
11
|
describe Xommelier::OpenSearch::Description do
|
6
12
|
describe '.parse' do
|
7
13
|
let(:osd_xml) { load_xml_file('opensearch.full') }
|
8
|
-
|
9
|
-
|
10
|
-
subject { description }
|
14
|
+
subject(:description) { Xommelier::OpenSearch::Description.parse(osd_xml) }
|
11
15
|
|
12
16
|
its(:adult_content) { should be_false }
|
13
17
|
its(:attribution) { should == "\n Search data Copyright 2005, Example.com, Inc., All Rights Reserved\n " }
|
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
require 'spec_helper'
|
2
9
|
|
3
10
|
describe 'RSS feed building' do
|
@@ -1,4 +1,10 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
2
8
|
require 'spec_helper'
|
3
9
|
require 'active_support/core_ext/numeric/time'
|
4
10
|
require 'xommelier/rss'
|
@@ -6,9 +12,7 @@ require 'xommelier/rss'
|
|
6
12
|
describe 'RSS feed' do
|
7
13
|
describe 'parsing' do
|
8
14
|
let(:rss_xml) { load_xml_file('feed.rss2.0') }
|
9
|
-
|
10
|
-
|
11
|
-
subject { feed }
|
15
|
+
subject(:feed) { Xommelier::RSS::Rss.parse(rss_xml) }
|
12
16
|
|
13
17
|
it { should be_kind_of(Xommelier::RSS::Rss) }
|
14
18
|
|
@@ -25,8 +29,7 @@ describe 'RSS feed' do
|
|
25
29
|
|
26
30
|
it { feed.should have(4).items }
|
27
31
|
describe 'Item' do
|
28
|
-
|
29
|
-
subject { item }
|
32
|
+
subject(:item) { feed.items[0] }
|
30
33
|
|
31
34
|
its(:guid) { should be_an Xommelier::RSS::Guid }
|
32
35
|
its('guid.text') { should == 'http://liftoff.msfc.nasa.gov/2003/06/03.html#item573' }
|
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
require 'spec_helper'
|
2
9
|
|
3
10
|
describe Xommelier::Atom::Entry do
|
@@ -0,0 +1,102 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
8
|
+
require 'spec_helper'
|
9
|
+
|
10
|
+
describe Xommelier::DS do
|
11
|
+
its('xmlns.uri') { should == 'http://www.w3.org/2000/09/xmldsig#' }
|
12
|
+
end
|
13
|
+
|
14
|
+
describe Xommelier::DS::Signature do
|
15
|
+
it { should respond_to(:signed_info) }
|
16
|
+
it { should respond_to(:signature_value) }
|
17
|
+
it { should respond_to(:key_info) }
|
18
|
+
end
|
19
|
+
|
20
|
+
describe Xommelier::DS::SignedInfo do
|
21
|
+
it { should respond_to(:canonicalization_method) }
|
22
|
+
it { should respond_to(:signature_method) }
|
23
|
+
it { should respond_to(:reference) }
|
24
|
+
end
|
25
|
+
|
26
|
+
describe Xommelier::DS::CanonicalizationMethod do
|
27
|
+
it { should respond_to(:algorithm) }
|
28
|
+
|
29
|
+
describe '.new_omit_comments' do
|
30
|
+
subject { described_class.new_omit_comments }
|
31
|
+
its('algorithm.to_s') { should == 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315' }
|
32
|
+
end
|
33
|
+
|
34
|
+
describe '.new_with_comments' do
|
35
|
+
subject { described_class.new_with_comments }
|
36
|
+
its('algorithm.to_s') { should == 'http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments' }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe Xommelier::DS::SignatureMethod do
|
41
|
+
it { should respond_to(:hmac_output_length) }
|
42
|
+
|
43
|
+
describe '.new_rsa_sha1' do
|
44
|
+
subject { described_class.new_rsa_sha1 }
|
45
|
+
its('algorithm.to_s') { should == 'http://www.w3.org/2000/09/xmldsig#rsa-sha1' }
|
46
|
+
end
|
47
|
+
|
48
|
+
describe '.new_dsa_sha1' do
|
49
|
+
subject { described_class.new_dsa_sha1 }
|
50
|
+
its('algorithm.to_s') { should == 'http://www.w3.org/2000/09/xmldsig#dsa-sha1' }
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe Xommelier::DS::Transform do
|
55
|
+
it { should respond_to(:xpath) }
|
56
|
+
|
57
|
+
describe '.new_xslt' do
|
58
|
+
subject { described_class.new_xslt }
|
59
|
+
its('algorithm.to_s') { should == 'http://www.w3.org/TR/1999/REC-xslt-19991116' }
|
60
|
+
its('algorithm_name') { should == :xslt }
|
61
|
+
end
|
62
|
+
|
63
|
+
describe '.new_xpath' do
|
64
|
+
subject { described_class.new_xpath }
|
65
|
+
its('algorithm.to_s') { should == 'http://www.w3.org/TR/1999/REC-xpath-19991116' }
|
66
|
+
its('algorithm_name') { should == :xpath }
|
67
|
+
end
|
68
|
+
|
69
|
+
describe '.new_enveloped_signature' do
|
70
|
+
subject { described_class.new_enveloped_signature }
|
71
|
+
its('algorithm.to_s') { should == 'http://www.w3.org/2000/09/xmldsig#enveloped-signature' }
|
72
|
+
its('algorithm_name') { should == :enveloped_signature }
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
describe Xommelier::DS::DigestMethod do
|
77
|
+
describe '.new_sha1' do
|
78
|
+
subject { described_class.new_sha1 }
|
79
|
+
its('algorithm.to_s') { should == 'http://www.w3.org/2000/09/xmldsig#sha1' }
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
describe Xommelier::DS::Reference do
|
84
|
+
it { should respond_to(:digest_method) }
|
85
|
+
it { should respond_to(:digest_value) }
|
86
|
+
it { should respond_to(:uri) }
|
87
|
+
end
|
88
|
+
|
89
|
+
describe Xommelier::DS::Signature, '(signature-example-rsa.xml)' do
|
90
|
+
let(:ds_rsa_xml) { load_xml_file('ds_rsa') }
|
91
|
+
subject(:ds_rsa) { Xommelier::DS::Signature.parse(ds_rsa_xml) }
|
92
|
+
|
93
|
+
describe Xommelier::DS::Signature do
|
94
|
+
its(:signed_info) { should be_present }
|
95
|
+
its(:signature_value) { should be_present }
|
96
|
+
its(:key_info) { should be_present }
|
97
|
+
end
|
98
|
+
|
99
|
+
describe Xommelier::DS::SignedInfo do
|
100
|
+
subject(:signed_info) { ds_rsa.signed_info }
|
101
|
+
end
|
102
|
+
end
|
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
require 'spec_helper'
|
2
9
|
|
3
10
|
describe Xommelier::RSS::EmailAddress do
|
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
require 'spec_helper'
|
2
9
|
|
3
10
|
describe Xommelier::Xml::Element::Serialization do
|
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
require 'spec_helper'
|
2
9
|
|
3
10
|
describe Xommelier::Xml::Element::Structure do
|
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
require 'spec_helper'
|
2
9
|
|
3
10
|
describe Xommelier::Xml::Element do
|
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
require 'spec_helper'
|
2
9
|
|
3
10
|
describe Xommelier::Xml do
|
data/spec/lib/xommelier_spec.rb
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
require 'spec_helper'
|
2
9
|
|
3
10
|
describe Xommelier do
|
data/spec/namespaced_module.rb
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
module NamespacedModule
|
2
9
|
include Xommelier::Xml
|
3
10
|
|
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
SPEC_ROOT = File.expand_path('../..', __FILE__)
|
2
9
|
require 'simplecov'
|
3
10
|
require 'bundler/setup'
|
data/spec/support/fixtures.rb
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
def load_xml_file(file_name)
|
2
9
|
open(File.join(SPEC_ROOT, 'spec', 'fixtures', "#{file_name}.xml")).read
|
3
10
|
end
|
@@ -1,3 +1,10 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
################################################
|
4
|
+
# © Alexander Semyonov, 2011—2013, MIT License #
|
5
|
+
# Author: Alexander Semyonov <al@semyonov.us> #
|
6
|
+
################################################
|
7
|
+
|
1
8
|
require 'rspec'
|
2
9
|
shared_examples 'Valid XML Document' do
|
3
10
|
it { subject.class.schema.should be_present }
|
data/xommelier.gemspec
CHANGED