archivesspace-client 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d62f24f62e27e4dcb265982a09d19929029a12d7926983137f7835b9e945ec8d
|
|
4
|
+
data.tar.gz: 88b7f1d79f02207cba4dfbb6334fae4a7080adca8634c6c52b53d6616398dfd0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d776656385e5e84c4ba0adfec158e6a43ef60720aec43108a15e6e307adaf5022eb2168d463cdc74f4657aae62bbea80662d851dc65aee8a4ed02b1f9cc432d2
|
|
7
|
+
data.tar.gz: 482eeab5c389e3433bae0102a687dfc42ede31792bf0b9bafcd2b0ec22492769523c42639718f9c202fc83abd2b08b6b798a7827826441c2ee951de9d817eda9
|
|
@@ -14,7 +14,7 @@ module ArchivesSpace
|
|
|
14
14
|
@method = method.downcase.to_sym
|
|
15
15
|
@path = path.gsub(%r{^/+}, "")
|
|
16
16
|
|
|
17
|
-
@options = options
|
|
17
|
+
@options = options.dup
|
|
18
18
|
|
|
19
19
|
@options[:headers] = DEFAULT_HEADERS.merge(@options.fetch(:headers, {}))
|
|
20
20
|
@options[:headers]["User-Agent"] = "#{Client::NAME}/#{Client::VERSION}"
|
|
@@ -158,6 +158,24 @@ describe ArchivesSpace::Client do
|
|
|
158
158
|
request = ArchivesSpace::Request.new(nil, client.config)
|
|
159
159
|
expect(request.options[:headers]["User-Agent"]).to eq "#{ArchivesSpace::Client::NAME}/#{ArchivesSpace::Client::VERSION}"
|
|
160
160
|
end
|
|
161
|
+
|
|
162
|
+
it "does not mutate the caller's options hash" do
|
|
163
|
+
opts = {query: {foo: "bar"}, headers: {"X-Custom" => "1"}}
|
|
164
|
+
caller_opts = Marshal.load(Marshal.dump(opts))
|
|
165
|
+
ArchivesSpace::Request.new(nil, client.config, "GET", "resources", opts)
|
|
166
|
+
expect(opts).to eq(caller_opts)
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
it "does not mutate the caller's options hash when injecting the session token" do
|
|
170
|
+
client.token = "abc123"
|
|
171
|
+
opts = {query: {foo: "bar"}}
|
|
172
|
+
caller_opts = Marshal.load(Marshal.dump(opts))
|
|
173
|
+
allow(ArchivesSpace::Request).to receive(:new).and_return(
|
|
174
|
+
double("request", execute: double("response", status_code: 200))
|
|
175
|
+
)
|
|
176
|
+
client.get("resources", opts)
|
|
177
|
+
expect(opts).to eq(caller_opts)
|
|
178
|
+
end
|
|
161
179
|
end
|
|
162
180
|
|
|
163
181
|
describe "URL construction" do
|