ezid-client 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/ezid/identifier.rb +1 -1
- data/spec/unit/identifier_spec.rb +25 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac92a9017e776a4c88d7577881022af87f2d755d
|
4
|
+
data.tar.gz: 3be1a1ee6ee37c784ce6bf07810ca0d3be2d4fc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb1f24f662eeed776a0c1380759ff9200e2e4619b04e553658c8ef96dc999985363abbfc5e454a6630cd9e38d5da9e6b25b6a98f1a85d1ab1274cb3fa371f630
|
7
|
+
data.tar.gz: 5467514182de6d43ef1128065b6193440e42345d72e80e9b91e6f29dde5db927d7cb65ab9e772e523c05dc27b9a9dd9486ad3db9fbd745ab7c9b7a36325acac4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.1
|
data/lib/ezid/identifier.rb
CHANGED
@@ -35,7 +35,7 @@ module Ezid
|
|
35
35
|
end
|
36
36
|
if id.nil?
|
37
37
|
warn "[DEPRECATION] Calling `create` without an id will raise an exception in 2.0. Use `mint` instead. (called from #{caller.first})"
|
38
|
-
shoulder = metadata.delete(:shoulder)
|
38
|
+
shoulder = metadata ? metadata.delete(:shoulder) : nil
|
39
39
|
mint(shoulder, metadata)
|
40
40
|
else
|
41
41
|
new(id, metadata) { |i| i.save }
|
@@ -2,10 +2,31 @@ module Ezid
|
|
2
2
|
RSpec.describe Identifier do
|
3
3
|
describe "class methods" do
|
4
4
|
describe ".create" do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
describe "with id and metadata args" do
|
6
|
+
it "instantiates a new Identifier and saves it" do
|
7
|
+
expect_any_instance_of(described_class).to receive(:save) { double(id: "id") }
|
8
|
+
described_class.create("id", profile: "dc", target: "http://example.com")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
describe "with an id arg" do
|
12
|
+
it "instantiates a new Identifier and saves it" do
|
13
|
+
expect_any_instance_of(described_class).to receive(:save) { double(id: "id") }
|
14
|
+
described_class.create("id")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
describe "with a hash metadata arg" do
|
18
|
+
it "mints a new Identifier" do
|
19
|
+
skip "DEPRECATED"
|
20
|
+
expect(described_class).to receive(:mint).with(nil, profile: "dc", target: "http://example.com")
|
21
|
+
described_class.create(profile: "dc", target: "http://example.com")
|
22
|
+
end
|
23
|
+
end
|
24
|
+
describe "with no args" do
|
25
|
+
it "mints a new Identifier" do
|
26
|
+
skip "DEPRECATED"
|
27
|
+
expect(described_class).to receive(:mint).with(nil, nil)
|
28
|
+
described_class.create
|
29
|
+
end
|
9
30
|
end
|
10
31
|
end
|
11
32
|
describe ".mint" do
|