From 48bd12232ed8966af038211ad0903acd9be4a28d Mon Sep 17 00:00:00 2001 From: Kazuma Murata Date: Wed, 16 Aug 2023 10:44:39 +0900 Subject: [PATCH 1/2] add annotations for rspec-core and rspec-expectations --- index.json | 16 ++++++++++++++++ rbi/annotations/rspec-core.rbi | 11 +++++++++++ rbi/annotations/rspec-expectations.rbi | 8 ++++++++ 3 files changed, 35 insertions(+) create mode 100644 rbi/annotations/rspec-core.rbi create mode 100644 rbi/annotations/rspec-expectations.rbi diff --git a/index.json b/index.json index 4ca6d792..5d9bf094 100644 --- a/index.json +++ b/index.json @@ -107,6 +107,22 @@ "rainbow/version" ] }, + "rspec-core": { + "dependencies": [ + "rspec" + ], + "requires": [ + "rspec" + ] + }, + "rspec-expectations": { + "dependencies": [ + "rspec" + ], + "requires": [ + "rspec" + ] + }, "shopify-money": { "requires": [ "money" diff --git a/rbi/annotations/rspec-core.rbi b/rbi/annotations/rspec-core.rbi new file mode 100644 index 00000000..b9794f13 --- /dev/null +++ b/rbi/annotations/rspec-core.rbi @@ -0,0 +1,11 @@ +# typed: true + +class RSpec::Core::ExampleGroup + class << self + sig { params(args: T.untyped, example_group_block: T.proc.bind(T.untyped).void).void } + def describe(*args, &example_group_block); end + + sig { params(all_args: T.untyped, block: T.proc.bind(RSpec::Matchers).void).void } + def it(*all_args, &block); end + end +end diff --git a/rbi/annotations/rspec-expectations.rbi b/rbi/annotations/rspec-expectations.rbi new file mode 100644 index 00000000..8878e0e9 --- /dev/null +++ b/rbi/annotations/rspec-expectations.rbi @@ -0,0 +1,8 @@ +# typed: true + +module RSpec + class << self + sig { params(args: T.untyped, example_group_block: T.proc.bind(T.class_of(RSpec::Core::ExampleGroup)).void).void } + def describe(*args, &example_group_block); end + end +end From 9c5d0b5560c2be5b9d1c2b269fd2bc906aa66dc7 Mon Sep 17 00:00:00 2001 From: Kazuma Murata Date: Wed, 16 Aug 2023 11:31:37 +0900 Subject: [PATCH 2/2] update an annotation for RSpec::Core::ExampleGroup.describe --- rbi/annotations/rspec-core.rbi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rbi/annotations/rspec-core.rbi b/rbi/annotations/rspec-core.rbi index b9794f13..7ab0e506 100644 --- a/rbi/annotations/rspec-core.rbi +++ b/rbi/annotations/rspec-core.rbi @@ -2,7 +2,7 @@ class RSpec::Core::ExampleGroup class << self - sig { params(args: T.untyped, example_group_block: T.proc.bind(T.untyped).void).void } + sig { params(args: T.untyped, example_group_block: T.proc.bind(T.class_of(RSpec::Core::ExampleGroup)).void).void } def describe(*args, &example_group_block); end sig { params(all_args: T.untyped, block: T.proc.bind(RSpec::Matchers).void).void }