Skip to content

Commit ea21df6

Browse files
committed
test for open api yaml
1 parent 6e3786d commit ea21df6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

spec/action_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@
127127
expect(action.fetch_version(ref: ref)).to eq("1.2.3")
128128
end
129129

130+
it 'returns the correct version for a openapi.yaml file' do
131+
mock_response('my_branch', mock_open_api_yaml_content('1.2.3'))
132+
133+
expect(action.fetch_version(ref: ref)).to eq("1.2.3")
134+
end
135+
130136
it 'returns the correct version for a package.json file' do
131137
mock_response('my_branch', mock_package_json_content('1.2.3'))
132138

@@ -275,6 +281,17 @@ def mock_gemspec_content(version)
275281
)
276282
end
277283

284+
def mock_open_api_yaml_content(version)
285+
%(
286+
openapi: 3.0.0
287+
info:
288+
title: Sample API
289+
description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.
290+
version: "#{version}"
291+
)
292+
end
293+
294+
278295
def mock_package_json_content(version)
279296
%(
280297
{

0 commit comments

Comments
 (0)