webspicy 0.20.0 → 0.20.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0bfd23b321b3e1216316e09c2b9e2d761a9e3179c62830d4b6a99b13042f4cc
4
- data.tar.gz: 0661ba60f10ac2433bb5952d3c17141d880363e1d0c763836877a08b9673a8d1
3
+ metadata.gz: 576301cb14f9cc4abcb10c8638e7b7994397e3bd91c0f3e48fea49ff356dc81d
4
+ data.tar.gz: e19dc03f7daa686ec2c97f9f83b28249a7ccf16de852b5844bf68cf99291944e
5
5
  SHA512:
6
- metadata.gz: d276e4fb01cfd084e94917d6987b9e545c8c28edeaa082b55330ac3978f28d3c358e39f9a09ceda6f0aff59e55f9ff0fd989c2f9c247885d78a6d89a7a82f37d
7
- data.tar.gz: bdfa965f896d9167432a8dbb4404720b9f278b590d031f92d8ad44c501be9a03e922a5bb58ae667644de803743210668cde3726ae0b901e6750f07ecb2718011
6
+ metadata.gz: e85cdd2ad61ed8b3e4a7d0362cd6543d6107ff4bbdba3586a3145c911e6d76d17a96347c28b56283804979ffea0a33ab47ba5426074450bc25b51ad78819c316
7
+ data.tar.gz: 3eb380f55e3f444f0cdd4268c00ef434b6f68ccca8cb10a3486be837a3d096dfd929d23b69d8ab872929995532491b9e3e41f1d44e2bff71ab078df10324a660
@@ -12,6 +12,7 @@ module Webspicy
12
12
  end
13
13
 
14
14
  def call
15
+ return unless invocation.is_structured_output?
15
16
  output = invocation.loaded_body
16
17
  service.error_schema.dress(output)
17
18
  rescue Finitio::TypeError => ex
@@ -12,6 +12,7 @@ module Webspicy
12
12
  end
13
13
 
14
14
  def call
15
+ return unless invocation.is_structured_output?
15
16
  output = invocation.loaded_body
16
17
  service.output_schema.dress(output)
17
18
  rescue Finitio::TypeError => ex
@@ -2,7 +2,7 @@ module Webspicy
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 20
5
- TINY = 0
5
+ TINY = 1
6
6
  end
7
7
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
8
8
  end
@@ -36,11 +36,14 @@ module Webspicy
36
36
  response.body.to_s
37
37
  end
38
38
 
39
- def loaded_output
39
+ def is_structured_output?
40
40
  ct = response.content_type || test_case.expected_content_type
41
41
  ct = ct.mime_type if ct.respond_to?(:mime_type)
42
- case ct
43
- when %r{json}
42
+ ct =~ /json/
43
+ end
44
+
45
+ def loaded_output
46
+ if is_structured_output?
44
47
  raise "Body empty while expected" if raw_output.empty?
45
48
  @loaded_output ||= ::JSON.parse(response.body)
46
49
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webspicy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.20.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau