vng 1.4.0 → 1.4.2
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/CHANGELOG.md +8 -0
- data/README.md +8 -0
- data/lib/vng/mock_request.rb +8 -5
- data/lib/vng/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0781c7c52c5481bf8199382df9e8567571e04e101ebefe00d313827009967954'
|
4
|
+
data.tar.gz: 9379c31ceff7d05ead68cbcd844c04ef5b44f6543c16852dbf0412f417c46812
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa6f6680041cd012ae6c6994c12e4b112ec6263cd3afad29efc64e5df40efa7c64a380ad745a7ec07150b02d7f62786f6ee3548df2ead54d5e9ce60f33024f53
|
7
|
+
data.tar.gz: 675eec6b8705c5516db5e8c140e5149f233a5114bf19d3639f4f5c3e129ce491b8e68ab80b2605adbed9d7a38806e1654bfa34a957ab817b1f3060c6efa96378
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
## [Unreleased] -
|
2
2
|
|
3
|
+
## [1.4.2] - 2024-12-03
|
4
|
+
|
5
|
+
- Fix MockRequest for no availability
|
6
|
+
|
7
|
+
## [1.4.1] - 2024-11-22
|
8
|
+
|
9
|
+
- Return more routes and availabilities in MockRequest
|
10
|
+
|
3
11
|
## [1.4] - 2024-11-22
|
4
12
|
|
5
13
|
- Change Availability#route_id from string to integer
|
data/README.md
CHANGED
@@ -62,6 +62,14 @@ Vng.configure do |config|
|
|
62
62
|
end
|
63
63
|
```
|
64
64
|
|
65
|
+
Mocking the Vonigo API
|
66
|
+
======================
|
67
|
+
|
68
|
+
Sometimes you want to mock the API requests to Vonigo and obtain results that
|
69
|
+
are equivalent to the original API calls. This can be useful to test your flow
|
70
|
+
without hitting the API.
|
71
|
+
|
72
|
+
|
65
73
|
Configuring with environment variables
|
66
74
|
--------------------------------------
|
67
75
|
|
data/lib/vng/mock_request.rb
CHANGED
@@ -23,7 +23,7 @@ module Vng
|
|
23
23
|
@query = options.fetch :query, {}
|
24
24
|
end
|
25
25
|
|
26
|
-
|
26
|
+
AVAILABLE_ROUTE_ID = 1630
|
27
27
|
@@logged_out = false
|
28
28
|
|
29
29
|
# Sends the request and returns the body parsed from the JSON response.
|
@@ -65,10 +65,12 @@ module Vng
|
|
65
65
|
{ "Ids"=>{ "franchiseID"=>"172" } }
|
66
66
|
elsif @body[:method] == '2'
|
67
67
|
{ "Ids"=>{ "lockID"=>"1406328" } }
|
68
|
+
elsif @body[:dateStart] == 2110060800 # 11/12/2036
|
69
|
+
{ "Availability"=> [] }
|
68
70
|
else
|
69
71
|
{ "Availability"=> [
|
70
|
-
{ "dayID"=>"20281119", "routeID"=>"#{
|
71
|
-
{ "dayID"=>"20281119", "routeID"=>"#{
|
72
|
+
{ "dayID"=>"20281119", "routeID"=>"#{AVAILABLE_ROUTE_ID}", "startTime"=>"1080" },
|
73
|
+
{ "dayID"=>"20281119", "routeID"=>"#{AVAILABLE_ROUTE_ID}", "startTime"=>"1110" },
|
72
74
|
] }
|
73
75
|
end
|
74
76
|
when '/api/v1/resources/breeds/'
|
@@ -113,8 +115,9 @@ module Vng
|
|
113
115
|
end
|
114
116
|
when '/api/v1/resources/Routes/'
|
115
117
|
{"Routes" => [
|
116
|
-
{"routeID" =>
|
117
|
-
{"routeID" => 2, "routeName" => "
|
118
|
+
{"routeID" => AVAILABLE_ROUTE_ID, "routeName" => "Route 1", "isActive" => true},
|
119
|
+
{"routeID" => 2, "routeName" => "Route 2", "isActive" => true},
|
120
|
+
{"routeID" => 3, "routeName" => "Route 3 (Inactive)", "isActive" => false},
|
118
121
|
]}
|
119
122
|
when '/api/v1/data/WorkOrders/'
|
120
123
|
{ "WorkOrder"=>{ "objectID"=>"4138030" } }
|
data/lib/vng/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- claudiob
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
|
-
rubygems_version: 3.5.
|
114
|
+
rubygems_version: 3.5.23
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: A Ruby client for the Vonigo API.
|