Skip to content

Commit 5be9bba

Browse files
committed
Add changelog and rspec
1 parent 7a44cb5 commit 5be9bba

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#### Fixes
88

99
* Your contribution here.
10-
10+
* [#384](https://github.com/ruby-grape/grape-entity/pull/384): Fixed the `inspect` method to correctly handle nil values. - [@fcce](https://github.com/fcce).
1111

1212
### ### 1.0.1 (2024-04-10)
1313

spec/grape_entity/entity_spec.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,6 @@ class NoPathCharacterEntity < Grape::Entity
17541754
end
17551755
end
17561756
end
1757-
17581757
describe '#inspect' do
17591758
before do
17601759
fresh_class.class_eval do
@@ -1769,6 +1768,12 @@ class NoPathCharacterEntity < Grape::Entity
17691768
expect(data).to_not include '@options'
17701769
expect(data).to_not include '@delegator'
17711770
end
1771+
1772+
it 'returns a nil string when subject is nil' do
1773+
data = subject.class.new(nil).inspect
1774+
expect(data).to include 'nil'
1775+
end
1776+
17721777
end
17731778

17741779
describe '#value_for' do

0 commit comments

Comments
 (0)