rest-in-peace 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.0
1
+ 1.3.1
@@ -11,6 +11,8 @@ module RESTinPeace
11
11
  convert_from_array
12
12
  when 'Hash'
13
13
  convert_from_hash
14
+ when 'String'
15
+ @response.body
14
16
  else
15
17
  raise "Don't know how to convert #{@response.body.class}"
16
18
  end
@@ -22,6 +22,12 @@ describe RESTinPeace::ResponseConverter do
22
22
  specify { expect(subject).to eq(OpenStruct.new(name: 'test1')) }
23
23
  end
24
24
 
25
+ shared_examples_for 'a string input' do
26
+ let(:response_body) { 'yolo binary stuff' }
27
+ specify { expect(subject).to be_instance_of(String) }
28
+ specify { expect(subject).to eq('yolo binary stuff') }
29
+ end
30
+
25
31
  context 'given type is a class' do
26
32
  let(:klass) { OpenStruct }
27
33
  context 'input is an array' do
@@ -31,6 +37,10 @@ describe RESTinPeace::ResponseConverter do
31
37
  context 'input is a hash' do
32
38
  it_behaves_like 'a hash input'
33
39
  end
40
+
41
+ context 'input is a string' do
42
+ it_behaves_like 'a string input'
43
+ end
34
44
  end
35
45
 
36
46
  context 'given type is an instance' do
@@ -42,6 +52,10 @@ describe RESTinPeace::ResponseConverter do
42
52
  context 'input is a hash' do
43
53
  it_behaves_like 'a hash input'
44
54
  end
55
+
56
+ context 'input is a string' do
57
+ it_behaves_like 'a string input'
58
+ end
45
59
  end
46
60
  end
47
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-in-peace
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: