utensils 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/utensils/json.rb +11 -2
- data/lib/utensils/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2aa7aa7707ea24394fb420d097e999f19d837a18
|
4
|
+
data.tar.gz: 02e3f6e4d3f253b1b98b07ad618a1d12276335bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49f1689a38a91453b5fbe6e06a0f7cebcdb5d27c8c6c16d2846e10ca1366cb17442af1272315063c10c146cf853aa619bdbf41aa7b5ccff35af3758b094a8142
|
7
|
+
data.tar.gz: b27f06279312a4d870f82b92cb4697bc49675de1a950f4554e5b0a89e220bdfe68597685c7b8ed2cc23ccb487777e76bdc501cc337f8ed02d2b8c499497fbcee
|
data/lib/utensils/json.rb
CHANGED
@@ -3,14 +3,23 @@ module JsonHelpers
|
|
3
3
|
expect(json_response(path))
|
4
4
|
end
|
5
5
|
|
6
|
-
def expect_json(
|
7
|
-
expect(parse_json(
|
6
|
+
def expect_json(json, path = nil)
|
7
|
+
expect(parse_json(json, path))
|
8
8
|
end
|
9
9
|
|
10
10
|
def json_response(path = nil)
|
11
11
|
parse_json(spec_type_agnostic_response_body, path)
|
12
12
|
end
|
13
13
|
|
14
|
+
# Similar to `save_and_open_page`, to temporarily inspect nicely formatted contents of JSON response
|
15
|
+
def save_and_open_json
|
16
|
+
file_path = Rails.root.join("tmp", "json.rb").to_s
|
17
|
+
output = parse_json(spec_type_agnostic_response_body)
|
18
|
+
output = PP.pp(output, "")
|
19
|
+
File.write(file_path, output, mode: "wb")
|
20
|
+
Launchy.open(file_path)
|
21
|
+
end
|
22
|
+
|
14
23
|
private
|
15
24
|
|
16
25
|
def spec_type_agnostic_response_body
|
data/lib/utensils/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utensils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Balvig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rspec stuff we use over and over again
|
14
14
|
email:
|