diff --git a/spec/spec_with_project.rb b/spec/spec_with_project.rb index 541c6f90f..182636037 100644 --- a/spec/spec_with_project.rb +++ b/spec/spec_with_project.rb @@ -104,6 +104,13 @@ def assert_project_file_exist(path) assert(@project.file?(path)) end + # Assert that `path` exists inside project. + # `Path` can include patterns such as `*`, useful for testing RBIs for real gems + sig { params(path: String).void } + def assert_project_file_match(path) + assert(Dir[path].any?) + end + # Refute that `path` exists inside `@project` sig { params(path: String).void } def refute_project_file_exist(path) diff --git a/spec/tapioca/cli/gem_spec.rb b/spec/tapioca/cli/gem_spec.rb index cbca14aa7..80495571d 100644 --- a/spec/tapioca/cli/gem_spec.rb +++ b/spec/tapioca/cli/gem_spec.rb @@ -800,7 +800,7 @@ class Secret; end assert_project_file_exist("sorbet/rbi/gems/foo@0.0.1.rbi") assert_project_file_exist("sorbet/rbi/gems/bar@0.3.0.rbi") assert_project_file_exist("sorbet/rbi/gems/actionpack@7.0.6.rbi") - assert_project_file_exist("sorbet/rbi/gems/rack@2.2.10.rbi") + assert_project_file_match("sorbet/rbi/gems/rack@*.rbi") refute_project_file_exist("sorbet/rbi/gems/baz@0.0.2.rbi") assert_empty_stderr(result)