xmlenc 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ca6e55c68b610b3555faafb61cdfbe906bf99c9
4
- data.tar.gz: e09a38a6274ecbcbab0072740b7d77d465096db8
3
+ metadata.gz: ab733b0cf61182307e356ed8ff07aa948fd794e0
4
+ data.tar.gz: bdfc59ff13e17a2044dedbeab8e8a0cca8af8dfc
5
5
  SHA512:
6
- metadata.gz: 0afac48b7eacf0907ef0c8dd45a25924a8768be8ac7107d7e297d337bdbcd28ed5658eaf0e7340bfa2fe018e394764e37ae00397e695a94bad5bf8c9a1f6b1d1
7
- data.tar.gz: 11e357408fd5b91fa3b1b6b7419c601bdd685a974d931d3e3b3b98d888678c4d61d283e2be6c947ef017d621d8ace6133b30f98101f33f49ad69d6f30c31d836
6
+ metadata.gz: c3baf160e59ac781cf6c271d78df1c61092b7f13db4c42189c8a46d31e7165f45b3d806ab00a9af1c78c8699bc398216072a85247bc909f667eb521d409397e4
7
+ data.tar.gz: 3bb19668cd7317d46ffc8a3439d94a55f44e124b8787c92ec2168df714a2ee760b4bb92295a6a6ab90c3672558dcbbc305fc38e7ea0e23da1ee0396cb4778d2b
@@ -28,7 +28,7 @@ module Xmlenc
28
28
  if options.key?(:id)
29
29
  self.id = options.delete(:id)
30
30
  else
31
- self.id = SecureRandom.hex(5)
31
+ self.id = "_#{SecureRandom.hex(5)}"
32
32
  end
33
33
  super(*(args << options))
34
34
  end
@@ -1,3 +1,3 @@
1
1
  module Xmlenc
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
@@ -73,12 +73,20 @@ describe Xmlenc::Builder::EncryptedData do
73
73
  end
74
74
 
75
75
  describe "#initialize" do
76
- it 'sets a default #id' do
77
- expect(described_class.new().id).to be_a String
76
+ context 'no id specified' do
77
+ it 'sets a default #id' do
78
+ expect(described_class.new().id).to be_a String
79
+ end
80
+
81
+ it 'the default #id should start with a letter or an _' do
82
+ expect(described_class.new.id =~ /^[a-zA-Z_]/).not_to eq nil
83
+ end
78
84
  end
79
85
 
80
- it 'sets #id to specified id' do
81
- expect(described_class.new(id: 'TEST').id).to eq 'TEST'
86
+ context 'id specified' do
87
+ it 'sets #id to specified id' do
88
+ expect(described_class.new(id: 'TEST').id).to eq 'TEST'
89
+ end
82
90
  end
83
91
  end
84
92
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xmlenc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoist
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-08 00:00:00.000000000 Z
11
+ date: 2015-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport