Skip to content

Commit

Permalink
Add changelog and rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
fcce committed May 6, 2024
1 parent 7a44cb5 commit 5be9bba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#### Fixes

* Your contribution here.

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

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

Expand Down
7 changes: 6 additions & 1 deletion spec/grape_entity/entity_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,6 @@ class NoPathCharacterEntity < Grape::Entity
end
end
end

describe '#inspect' do
before do
fresh_class.class_eval do
Expand All @@ -1769,6 +1768,12 @@ class NoPathCharacterEntity < Grape::Entity
expect(data).to_not include '@options'
expect(data).to_not include '@delegator'
end

it 'returns a nil string when subject is nil' do
data = subject.class.new(nil).inspect
expect(data).to include 'nil'
end

end

describe '#value_for' do
Expand Down

0 comments on commit 5be9bba

Please sign in to comment.