Skip to content

Commit 88a1c1f

Browse files
committed
Fix Definition#inspect
1 parent c5f95d9 commit 88a1c1f

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

lib/openapi_first/definition.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def key
5959
end
6060

6161
def inspect
62-
"#<#{self.class.name} @key=#{key}>"
62+
"#<#{self.class.name} @key='#{key}'>"
6363
end
6464

6565
# Validates the request against the API description.

spec/definition_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ def build_request(path, method: 'GET')
1212
end
1313
end
1414

15+
describe '#inspect' do
16+
it 'returns a frozen configuration' do
17+
definition = OpenapiFirst.load('./spec/data/petstore.yaml')
18+
expect(definition.inspect).to eq("#<OpenapiFirst::Definition @key='./spec/data/petstore.yaml'>")
19+
end
20+
end
21+
1522
describe '#[]' do
1623
it 'gives access to the raw hash' do
1724
definition = OpenapiFirst.load('./spec/data/train-travel-api/openapi.yaml')

0 commit comments

Comments
 (0)