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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 85abce8ddfb00cc4480ced1de3389c20a8bb748c60f4fc58e9243023db4b0b18
4
- data.tar.gz: 2186d43bab992f50781ca85c8f6de07fc6830558feb92d1725713900765f19ab
3
+ metadata.gz: e87c54742bdb4c00801a6ae3fa7d138f2be9d9ac29684bc26a9b446acd95c57c
4
+ data.tar.gz: 9f87ff03c217d5f3c5f2404777c4e80fae0ab6d99acc6ef31e63af7cc588d05a
5
5
  SHA512:
6
- metadata.gz: 6d9f59078d27bb6979f9607ab4de03adfb09cce40f5ab8e0a1aee2ca24d54151cfb3922b5ae92c3f812e2ba8f00c5e2a624851e488ab82dacf74cbc6b8540118
7
- data.tar.gz: 71f971e665b96b864565ec04c95230589d34776b8997e0caea8ead21aaf728963a42f3326ca5a3b3d21fe5feb29dcd06a0ee0f689559f495f21681bf26851981
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Halchemy
4
- VERSION = "1.0.3"
4
+ VERSION = "1.0.4"
5
5
  end
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.3
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-01-27 00:00:00.000000000 Z
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
@@ -1,2 +0,0 @@
1
- [halchemy]
2
- parameters_list_style = comma