From 0e35b67d784d9452d7921a6775df9eaf17e7a68c Mon Sep 17 00:00:00 2001 From: Kaan Ozkan Date: Mon, 11 Sep 2023 16:48:07 -0400 Subject: [PATCH] Update expected test output for parsing failures --- spec/tapioca/cli/annotations_spec.rb | 2 +- spec/tapioca/cli/check_shims_spec.rb | 2 +- spec/tapioca/cli/gem_spec.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/tapioca/cli/annotations_spec.rb b/spec/tapioca/cli/annotations_spec.rb index e4a1d9139..09f4e4fcd 100644 --- a/spec/tapioca/cli/annotations_spec.rb +++ b/spec/tapioca/cli/annotations_spec.rb @@ -148,7 +148,7 @@ class AnnotationForSpoom assert_stderr_includes(result, <<~ERR) Can't import RBI file for `spoom` as it contains errors: - Error: Expected to be able to parse an expression. Expected `end` to close `class` statement. (-:4:0-3:25) + Error: Cannot parse the expression. Expected an `end` to close the `class` statement. (-:4:0) ERR refute_includes(result.out, "create sorbet/rbi/annotations/spoom.rbi") diff --git a/spec/tapioca/cli/check_shims_spec.rb b/spec/tapioca/cli/check_shims_spec.rb index 21861cb16..940f969be 100644 --- a/spec/tapioca/cli/check_shims_spec.rb +++ b/spec/tapioca/cli/check_shims_spec.rb @@ -470,7 +470,7 @@ def foo; end assert_equal(<<~ERR, result.err) - Warning: Expected to be able to parse an expression. Expected `end` to close `class` statement. (sorbet/rbi/shims/foo.rbi:2:0-1:10) + Warning: Cannot parse the expression. Expected an `end` to close the `class` statement. (sorbet/rbi/shims/foo.rbi:2:0) Duplicated RBI for ::Foo#foo: * sorbet/rbi/shims/bar.rbi:2:2-2:14 diff --git a/spec/tapioca/cli/gem_spec.rb b/spec/tapioca/cli/gem_spec.rb index ac5bec69d..e7f73f271 100644 --- a/spec/tapioca/cli/gem_spec.rb +++ b/spec/tapioca/cli/gem_spec.rb @@ -461,9 +461,9 @@ module Foo # Syntax error assert_stderr_includes(result, "RBIs exported by `foo` contain errors and can't be used:") assert_stderr_includes( result, - "Cause: Expected to be able to parse an expression. Expected `end` to close `module` statement. ", + "Cause: Cannot parse the expression. Expected an `end` to close the `module` statement. ", ) - assert_stderr_includes(result, "foo/rbi/foo.rbi:2:0-1:26") + assert_stderr_includes(result, "foo/rbi/foo.rbi:2:0") assert_project_file_equal("sorbet/rbi/gems/foo@0.0.1.rbi", FOO_RBI)