rest-in-peace 5.0.1 → 5.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -4,11 +4,13 @@ rvm:
4
4
  - 1.9.3
5
5
  - 2.0.0
6
6
  - 2.1.2
7
+ - 2.2.4
8
+ - 2.3.0
7
9
  gemfile:
8
- - gemfiles/Gemfile.rails-3.2.x
9
- - gemfiles/Gemfile.rails-4.0.x
10
- - gemfiles/Gemfile.rails-4.1.x
11
- - gemfiles/Gemfile.rails-4.2.x
10
+ - gemfiles/Gemfile.activemodel-3.2.x
11
+ - gemfiles/Gemfile.activemodel-4.0.x
12
+ - gemfiles/Gemfile.activemodel-4.1.x
13
+ - gemfiles/Gemfile.activemodel-4.2.x
12
14
  script:
13
15
  - bundle exec rake spec
14
16
  before_install: gem install bundler
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.0.1
1
+ 5.0.2
@@ -2,4 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec path: '../'
4
4
 
5
- gem 'rails', '~> 3.2.0'
5
+ gem 'activemodel', '~> 3.2.0'
@@ -2,4 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec path: '../'
4
4
 
5
- gem 'rails', '~> 4.0.0'
5
+ gem 'activemodel', '~> 4.0.0'
@@ -2,4 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec path: '../'
4
4
 
5
- gem 'rails', '~> 4.1.0'
5
+ gem 'activemodel', '~> 4.1.0'
@@ -2,4 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec path: '../'
4
4
 
5
- gem 'rails', '~> 4.2.0'
5
+ gem 'activemodel', '~> 4.2.0'
@@ -28,6 +28,8 @@ module RESTinPeace
28
28
  convert_from_hash
29
29
  when 'String'
30
30
  body
31
+ when 'NilClass'
32
+ nil
31
33
  else
32
34
  raise UnknownConvertStrategy, body.class
33
35
  end
@@ -42,6 +42,12 @@ describe RESTinPeace::ResponseConverter do
42
42
  specify { expect(subject).to eq('yolo binary stuff') }
43
43
  end
44
44
 
45
+ shared_examples_for 'a nil object input' do
46
+ let(:response_body) { nil }
47
+ specify { expect(subject).to be_instance_of(NilClass) }
48
+ specify { expect(subject).to eq(nil) }
49
+ end
50
+
45
51
  shared_examples_for 'an unknown input do' do
46
52
  let(:response_body) { Object }
47
53
  specify { expect { subject }.to raise_error(RESTinPeace::ResponseConverter::UnknownConvertStrategy) }
@@ -60,6 +66,10 @@ describe RESTinPeace::ResponseConverter do
60
66
  context 'input is a string' do
61
67
  it_behaves_like 'a string input'
62
68
  end
69
+
70
+ context 'input is a Nil object' do
71
+ it_behaves_like 'a nil object input'
72
+ end
63
73
  end
64
74
 
65
75
  context 'given type is an instance' do
@@ -75,6 +85,10 @@ describe RESTinPeace::ResponseConverter do
75
85
  context 'input is a string' do
76
86
  it_behaves_like 'a string input'
77
87
  end
88
+
89
+ context 'input is a Nil object' do
90
+ it_behaves_like 'a nil object input'
91
+ end
78
92
  end
79
93
  end
80
94
  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: 5.0.1
4
+ version: 5.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-03-10 00:00:00.000000000 Z
12
+ date: 2016-04-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -150,10 +150,10 @@ files:
150
150
  - Rakefile
151
151
  - VERSION
152
152
  - examples/pagination_with_headers.rb
153
- - gemfiles/Gemfile.rails-3.2.x
154
- - gemfiles/Gemfile.rails-4.0.x
155
- - gemfiles/Gemfile.rails-4.1.x
156
- - gemfiles/Gemfile.rails-4.2.x
153
+ - gemfiles/Gemfile.activemodel-3.2.x
154
+ - gemfiles/Gemfile.activemodel-4.0.x
155
+ - gemfiles/Gemfile.activemodel-4.1.x
156
+ - gemfiles/Gemfile.activemodel-4.2.x
157
157
  - images/rest_in_peace.gif
158
158
  - lib/rest-in-peace.rb
159
159
  - lib/rest_in_peace.rb