utensils 2.1.0 → 2.2.0

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
  SHA1:
3
- metadata.gz: 669775ae6fad4267c69b86b4fcdae65695f9ec30
4
- data.tar.gz: eb40b1ebaa3662b60f2aa38be48ba2224b74ff53
3
+ metadata.gz: 2aa7aa7707ea24394fb420d097e999f19d837a18
4
+ data.tar.gz: 02e3f6e4d3f253b1b98b07ad618a1d12276335bf
5
5
  SHA512:
6
- metadata.gz: cd15961348ec8d665dcfd3eecc7a0416bb6c3ee99ef84d6334c69cd476febf13afa28837e3cdb1d557f7b065579e0a32a22dd1116c4492f09559540a2728b140
7
- data.tar.gz: dbaec06277fca68c937e6eba86ea99478806363e197471323507f6492d4fca7ff37aef7325f2898a15e6cde8df47fdaff379a19b2efb59ff25139f46a9749b1a
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(body, path = nil)
7
- expect(parse_json(body, path))
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
@@ -1,3 +1,3 @@
1
1
  module Utensils
2
- VERSION = "2.1.0"
2
+ VERSION = "2.2.0"
3
3
  end
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.1.0
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: 2017-12-01 00:00:00.000000000 Z
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: