miniswag 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/miniswag/dsl.rb +5 -0
- data/lib/miniswag/version.rb +1 -1
- data/lib/tasks/miniswag_tasks.rake +2 -5
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 434d06b45f141df2f6c446e4255ebac027599bfd82f06318c820b158e1c04a21
|
|
4
|
+
data.tar.gz: d45e14ddf12d6b2968dfaeee7f11cfc3c42c2c4acfa61ad24b89b92940db415c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 319d2d350279345504db4cfbc5ebe9689d578f4d22f33acdad7078ec5ffeb82913d20e624d2d35d074c915e149a7b0e423f55e7a157ab69d58a56308ed4ba320
|
|
7
|
+
data.tar.gz: 7ff7cd93c7fefd971c7df2ace4a3160b1079e23e9d21d6de62e9b9498012733e394c47756952076b3a1b397f0089153436be5d488d9491f35655f49187e27ff1
|
data/lib/miniswag/dsl.rb
CHANGED
|
@@ -224,6 +224,11 @@ module Miniswag
|
|
|
224
224
|
validator = Miniswag::ResponseValidator.new
|
|
225
225
|
validator.validate!(captured_metadata, response)
|
|
226
226
|
|
|
227
|
+
# Register a Minitest assertion so tests are not flagged as "missing assertions"
|
|
228
|
+
expected_code = captured_metadata[:response][:code].to_s
|
|
229
|
+
assert_equal expected_code, response.code,
|
|
230
|
+
"Expected response code #{expected_code} but got #{response.code}"
|
|
231
|
+
|
|
227
232
|
# Run user's additional assertions
|
|
228
233
|
instance_exec(response, &user_block) if user_block
|
|
229
234
|
end
|
data/lib/miniswag/version.rb
CHANGED
|
@@ -6,14 +6,11 @@ namespace :miniswag do
|
|
|
6
6
|
pattern = ENV.fetch('PATTERN', 'test/integration/**/*_test.rb')
|
|
7
7
|
additional_opts = ENV.fetch('ADDITIONAL_OPTS', '')
|
|
8
8
|
|
|
9
|
-
# Set the env var so the minitest plugin activates
|
|
9
|
+
# Set the env var so the minitest plugin activates in the subprocess
|
|
10
10
|
ENV['MINISWAG_GENERATE'] = '1'
|
|
11
11
|
|
|
12
|
-
# Require the openapi_helper which configures Miniswag
|
|
13
|
-
helper_path = Rails.root.join('test', 'openapi_helper.rb')
|
|
14
|
-
require helper_path.to_s if File.exist?(helper_path)
|
|
15
|
-
|
|
16
12
|
# Run minitest with the matching pattern
|
|
13
|
+
# The openapi_helper is loaded by the test files themselves via require "openapi_helper"
|
|
17
14
|
args = [
|
|
18
15
|
'bin/rails', 'test',
|
|
19
16
|
*Dir.glob(pattern),
|