Skip to content

Instantly share code, notes, and snippets.

@alexevanczuk
Created November 20, 2025 20:44
Show Gist options
  • Select an option

  • Save alexevanczuk/9c2161f12e4daf9ee7734cf1c7ebf650 to your computer and use it in GitHub Desktop.

Select an option

Save alexevanczuk/9c2161f12e4daf9ee7734cf1c7ebf650 to your computer and use it in GitHub Desktop.
RSpec RBIs
# typed: strict
module RSpec
sig {params(args: T.untyped, example_group_block: T.proc.bind(Core::ExampleGroup).void).void}
def self.describe(*args, &example_group_block); end
sig {params(args: T.untyped, example_group_block: T.proc.bind(Core::ExampleGroup).void).void}
def self.xdescribe(*args, &example_group_block); end
sig {params(args: T.untyped, example_group_block: T.proc.bind(Core::ExampleGroup).void).void}
def self.context(*args, &example_group_block); end
sig {params(name: String, args: T.untyped, example_group_block: T.proc.bind(Core::ExampleGroup).void).void}
def self.shared_examples_for(name, *args, &example_group_block); end
sig {params(name: String, args: T.untyped, example_group_block: T.proc.bind(Core::ExampleGroup).params(args: T.untyped).void).void}
def self.shared_examples(name, *args, &example_group_block); end
sig {params(name: String, args: T.untyped, example_group_block: T.proc.bind(Core::ExampleGroup).void).void}
def self.shared_context(name, *args, &example_group_block); end
def self.test_each(*args, &block); end
module Core
class ExampleGroup
extend T::Helpers
abstract!
include RSpec::Matchers
def run; end
def call; end
def to_proc; end
def self.test_each(*args, &block); end
def self.test_each_hash(*args, &block); end
def test_each(*args, &block); end
def include(*args); end
def array_excluding(*args); end
def array_including(*args); end
def a_collection_containing_exactly(*args); end
def be_an_instance_of(*args); end
def an_instance_of(*args); end
def be_aml_rejected(*args); end
def hash_not_including(*args); end
def satisfying(&blk); end
def travel_to(*args, &block); end
def within(*args); end
def let(name, &block); end
def let!(name, &block); end
sig { returns(T.untyped) }
sig { params(name: T.nilable(Symbol), block: T.proc.bind(T.untyped).void).returns(T.untyped) }
def subject(name = nil, &block); end
sig { params(name: T.nilable(String), block: T.nilable(T.proc.bind(RSpec::Core::ExampleGroup).void)).returns(T.untyped) }
def its(name, &block); end
sig { params(block: T.proc.bind(RSpec::Core::ExampleGroup).void).returns(T.untyped) }
sig { params(scope: Symbol, block: T.proc.bind(RSpec::Core::ExampleGroup).void).returns(T.untyped) }
def before(scope = :each, &block); end
sig { params(block: T.proc.params(arg0: RSpec::Core::ExampleGroup).bind(RSpec::Core::ExampleGroup).void).returns(T.untyped) }
def around(&block); end
sig { params(scope: Symbol, block: T.proc.bind(T.untyped).void).returns(T.untyped) }
def after(scope = :each, &block); end
sig { params(name: String, type: T.nilable(Symbol), block: T.proc.bind(RSpec::Core::ExampleGroup).void).returns(T.untyped) }
def xit(name, type: nil, &block); end
sig { params(block: T.proc.bind(RSpec::Core::ExampleGroup).void).returns(T.untyped) }
sig { params(name: T.nilable(String), type: T.nilable(Symbol), block: T.proc.bind(RSpec::Core::ExampleGroup).void).returns(T.untyped) }
def it(name = nil, type: nil, &block); end
sig { params(block: T.proc.bind(RSpec::Core::ExampleGroup).void).returns(T.untyped) }
sig { params(name: T.nilable(String), type: T.nilable(Symbol), block: T.proc.bind(RSpec::Core::ExampleGroup).void).returns(T.untyped) }
def self.it(name = nil, type: nil, &block); end
sig { params(block: T.proc.bind(RSpec::Core::ExampleGroup).void).returns(T.untyped) }
def self.without_xact_wrapper(&block); end
def context(name, **metadata, &block); end
def aggregate_failures(**options, &block); end
def yield_control; end
def pending(name, **metadata, &block); end
def xcontext(name, &block); end
def create(*args); end
def attributes_for(*args); end
def build_list(*args); end
def create_list(*args); end
def build_stubbed(*args); end
def build(*args); end
def expect(*args); end
def allow(*args); end
def instance_double(*args); end
def class_double(*args); end
def be_an(*args); end
def output(*args); end
def all(*args); end
def instance_of(*args); end
def allow_any_instance_of(*args); end
def having_attributes(*args); end
sig { params(name: String, block: T.nilable(T.proc.bind(RSpec::Core::ExampleGroup).void)).returns(T.untyped) }
def include_context(name, &block); end
sig { params(name: String, block: T.proc.bind(RSpec::Core::ExampleGroup).void).returns(T.untyped) }
def shared_examples(name, &block); end
sig { params(name: String, block: T.proc.bind(RSpec::Core::ExampleGroup).void).returns(T.untyped) }
def shared_context(name, &block); end
sig { params(name: String, block: T.nilable(T.proc.bind(RSpec::Core::ExampleGroup).void)).returns(T.untyped) }
def it_behaves_like(name, &block); end
def stub_const(*args); end
def include_examples(*args); end
def be(*args); end
def eql(*args); end
def eq(*args); end
def equal(*args); end
def start_with(*args); end
def be_starts_with(*args); end
def exceed_query_limit(*args); end
def be_a_kind_of(*args); end
def match_array(*args); end
def be_within(*args); end
def be_between(*args); end
def is_expected;end
def a_kind_of(*args); end
def double(*args); end
def be_valid; end
def instance_double(*args); end
def have_http_status(*args); end
sig { params(name: T.nilable(T.any(T.any(String, Symbol), T::Array[T.any(String, Symbol)])), block: T.proc.bind(T.untyped).void).returns(T.untyped) }
def its(name = nil, &block); end
def expect(*args, &block); end
def respond_to(*args); end
def params; end
def headers; end
def have_key(*args); end
def be_in(*args); end
def be_falsey; end
def be_instance_of(*args); end
def assert_response(*args); end
def expect_offense(*args); end
def expect_correction(*args); end
def expect_no_offenses(*args); end
def an_object_having_attributes(*args); end
def kind_of(*args); end
def be_completed; end
def a_value; end
def be_kind_of(*args); end
def env; end
def expect_any_instance_of(*args); end
def change(*args, &block); end
def receive_message_chain(*args); end
def not_change(*args); end
def expect_successful_response(*args); end
def any_args; end
def anything; end
def match_response(*args); end
def have_attributes(*args); end
def contain_exactly(*args); end
def a_collection_containing_exactly(*args); end
def have_received(*args); end
def hash_including(*args); end
def satisfy(*args); end
def response; end
def json; end
def body; end
def be_present; end
def end_with(*args); end
def be_persisted; end
def travel_to(*args, &block); end
def a_string_matching(*args); end
def be_empty; end
def exist; end
def be_nil; end
def be_truthy; end
def a_truthy_value; end
def post(*args); end
def request; end
def head(*args); end
def patch(*args); end
def get(*args); end
def delete(*args); end
def a_hash_including(*args); end
def a_string_including(*args); end
def put(*args); end
def receive(*args); end
def raise_error(*args); end
def raise_exception(*args); end
def assert_equal(*args); end
def be_falsy; end
def match(*args); end
def be_a(*args); end
def shared_examples_for(*args); end
def be_frozen; end
end
end
end
module RSpec::Mocks::ExampleMethods
def allow(*args); end
def allow_any_instance_of(*args); end
def instance_double(*args); end
def receive(*args); end
end
module RSpec::Matchers
include Kernel
# alphabetical
def a_collection_including(*args); end
def a_hash_including(*args); end
def a_string_including(*args); end
def a_truthy_value(*args); end
def allow(*args); end
def allow_any_instance_of(*args); end
def an_object_having_attributes(*args); end
def an_object_satisfying(description = nil, &block); end
def anything; end
def be(*args); end
def be_nil; end
def change(*args); end
def contain_exactly(*args); end
def eq(*args); end
def equals(*args); end
def eql(*args); end
def expect(*args); end
def have_attributes(*args); end
def include(*args); end
def match(*args); end
def match_array(*args); end
def not_change(*args); end
def receive(*args); end
def satisfy; end
end
module RSpec::Rails::RequestExampleGroup
sig { params(url: String, as: T.untyped, params: T::Hash[T.untyped, T.untyped], headers: T::Hash[T.untyped, T.untyped]).void }
def put(url, as:, params:, headers:); end
def post; end
def response; end
end
class RSpec::Matchers::BuiltIn::Match
def initialize(obj)
end
def matches?(obj)
end
def failure_message
end
end
module RSpec::Core::Hooks
has_attached_class!(:out)
sig { params(args: T.untyped, block: T.proc.params(example: T.untyped).bind(T.attached_class).void).void}
def around(*args, &block); end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment