halchemy 1.0.3 → 1.0.4
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 +4 -4
- data/__tests__/make_http_requests/http_response_details.rb +24 -0
- data/lib/halchemy/version.rb +1 -1
- metadata +2 -3
- data/~halchemy +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e87c54742bdb4c00801a6ae3fa7d138f2be9d9ac29684bc26a9b446acd95c57c
|
4
|
+
data.tar.gz: 9f87ff03c217d5f3c5f2404777c4e80fae0ab6d99acc6ef31e63af7cc588d05a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5618d243df3795345ca9957fe31f9ebb20257e15193ff85b999fe45e9b8ab0d0b43ed336021e0e7b1c3fba3e9eeac519d757d10c65921ee6ac5d142d62c7d17
|
7
|
+
data.tar.gz: 0c119ff94a610604d861bfd6d5a9e1e44842c3e31c7c43482bf89cd651d302ddcf3e9f163001cf0e9b76712407d00be5749b702bae94230a22ef1777c789493a
|
@@ -58,3 +58,27 @@ Then(/^I can access the error details$/) do
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
61
|
+
|
62
|
+
When(/^I make a request that returns JSON in the body$/) do
|
63
|
+
response_body = {
|
64
|
+
"_status" => "ERR",
|
65
|
+
"_error" => {
|
66
|
+
"code" => 404,
|
67
|
+
"message" => "The requested URL was not found on the server. " /
|
68
|
+
"If you entered the URL manually please check your spelling and try again."
|
69
|
+
}
|
70
|
+
}.to_json
|
71
|
+
stub_request(:any, /.*/).to_return(body: response_body, status: 404)
|
72
|
+
|
73
|
+
@resource = {}
|
74
|
+
ALL_METHODS.each do |method|
|
75
|
+
@resource[method] = @api.follow(@root_resource).to("resource1").public_send(method)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
Then(/^I can use the body in the way my language supports JSON$/) do
|
80
|
+
ALL_METHODS.each do |method|
|
81
|
+
response = @resource[method]._halchemy.response
|
82
|
+
expect(response.body.respond_to?("to_json")).to be true
|
83
|
+
end
|
84
|
+
end
|
data/lib/halchemy/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: halchemy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Ottoson
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-02-10 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: Do you have an API that serves data following the HAL specification? The
|
13
13
|
**halchemy** library makes it easy for your client to make the most of that API.
|
@@ -70,7 +70,6 @@ files:
|
|
70
70
|
- sig/matchers.rbs
|
71
71
|
- sig/patterns.rbs
|
72
72
|
- test.sh
|
73
|
-
- "~halchemy"
|
74
73
|
homepage: https://github.com/pointw-dev/halchemy
|
75
74
|
licenses:
|
76
75
|
- MIT
|
data/~halchemy
DELETED