diff options
Diffstat (limited to 'vendor/gems')
-rw-r--r-- | vendor/gems/bundler-checksum/lib/bundler/checksum.rb | 3 | ||||
-rw-r--r-- | vendor/gems/ipynbdiff/lib/transformer.rb | 2 | ||||
-rw-r--r-- | vendor/gems/ipynbdiff/spec/transformer_spec.rb | 11 |
3 files changed, 14 insertions, 2 deletions
diff --git a/vendor/gems/bundler-checksum/lib/bundler/checksum.rb b/vendor/gems/bundler-checksum/lib/bundler/checksum.rb index c8d78eba111..40c42644964 100644 --- a/vendor/gems/bundler-checksum/lib/bundler/checksum.rb +++ b/vendor/gems/bundler-checksum/lib/bundler/checksum.rb @@ -19,7 +19,8 @@ module Bundler cached_checksum = fetch_checksum_from_file(spec) if cached_checksum.nil? - raise SecurityError, "Cached checksum for #{spec.full_name} not found. Please (re-)generate Gemfile.checksum" + raise SecurityError, "Cached checksum for #{spec.full_name} not found. Please (re-)generate Gemfile.checksum with " \ + "`bundle exec bundler-checksum init`. See https://docs.gitlab.com/ee/development/gemfile.html#updating-the-checksum-file." end validate_file_checksum(cached_checksum) diff --git a/vendor/gems/ipynbdiff/lib/transformer.rb b/vendor/gems/ipynbdiff/lib/transformer.rb index 1b2c63bb35c..9e666a20aa5 100644 --- a/vendor/gems/ipynbdiff/lib/transformer.rb +++ b/vendor/gems/ipynbdiff/lib/transformer.rb @@ -27,7 +27,7 @@ module IpynbDiff def validate_notebook(notebook) notebook_json = Oj::Parser.usual.parse(notebook) - return notebook_json if notebook_json.key?('cells') + return notebook_json if notebook_json&.key?('cells') raise InvalidNotebookError rescue EncodingError, Oj::ParseError, JSON::ParserError diff --git a/vendor/gems/ipynbdiff/spec/transformer_spec.rb b/vendor/gems/ipynbdiff/spec/transformer_spec.rb index c5873906ca9..660d0a2bd79 100644 --- a/vendor/gems/ipynbdiff/spec/transformer_spec.rb +++ b/vendor/gems/ipynbdiff/spec/transformer_spec.rb @@ -102,5 +102,16 @@ describe IpynbDiff::Transformer do end end end + + context 'when notebook can not be parsed' do + it 'raises error' do + notebook = '{"cells":[]}' + allow(Oj::Parser.usual).to receive(:parse).and_return(nil) + + expect do + IpynbDiff::Transformer.new.transform(notebook) + end.to raise_error(IpynbDiff::InvalidNotebookError) + end + end end end |