Skip to content

Commit b115018

Browse files
authored
CI: Fix json assertions. (#701)
1 parent cf27135 commit b115018

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Internal improvements:
1616
Testing improvements:
1717

1818
* Add ruby 3.4 to CI ([696](https://github.com/arsduo/koala/pull/696))
19+
* Fix json assertions in CI ([701](https://github.com/arsduo/koala/pull/701))
1920

2021
Others:
2122

spec/cases/api_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@
345345
response = Koala::HTTPService::Response.new(200, result.to_json, { "x-ad-account-usage" => "{\"acc_id_util_pct\"9.67}"})
346346
allow(Koala).to receive(:make_request).and_return(response)
347347

348-
expect(Koala::Utils.logger).to receive(:error).with(/JSON::ParserError:.*unexpected token at '{"acc_id_util_pct"9.67}' while parsing x-ad-account-usage = {"acc_id_util_pct"9.67}/)
348+
expect(Koala::Utils.logger).to receive(:error).with("JSON::ParserError: expected ':' after object key at line 1 column 19 while parsing x-ad-account-usage = {\"acc_id_util_pct\"9.67}")
349349
api.graph_call('anything')
350350
end
351351

spec/cases/graph_error_checker_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ module Facebook
112112
"x-app-usage" => '{invalid:json}'
113113
)
114114

115-
expect(Koala::Utils.logger).to receive(:error).with(/JSON::ParserError:.*unexpected token at '{invalid:json}' while parsing x-app-usage = {invalid:json}/)
115+
expect(Koala::Utils.logger).to receive(:error).with("JSON::ParserError: expected object key, got 'invalid:json}' at line 1 column 2 while parsing x-app-usage = {invalid:json}")
116116
expect(error.fb_app_usage).to eq(nil)
117117
end
118118

0 commit comments

Comments
 (0)