repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/upgrade.rb | Library/Homebrew/cmd/upgrade.rb | #: * `upgrade` [<install-options>] [`--fetch-HEAD`] [`--ignore-pinned`] [`--display-times`] [<formulae>]:
#: Upgrade outdated, unpinned brews (with existing install options).
#:
#: Options for the `install` command are also valid here.
#:
#: If `--fetch-HEAD` is passed, fetch the upstream repository to detect... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/--cache.rb | Library/Homebrew/cmd/--cache.rb | #: * `--cache`:
#: Display Homebrew's download cache. See also `HOMEBREW_CACHE`.
#:
#: * `--cache` [`--build-from-source`|`-s`] [`--force-bottle`] <formula>:
#: Display the file or directory used to cache <formula>.
require "fetch"
module Homebrew
module_function
def __cache
if ARGV.named.empty?
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/tap.rb | Library/Homebrew/cmd/tap.rb | #: * `tap`:
#: List all installed taps.
#:
#: * `tap` [`--full`] [`--force-auto-update`] <user>`/`<repo> [<URL>]:
#: Tap a formula repository.
#:
#: With <URL> unspecified, taps a formula repository from GitHub using HTTPS.
#: Since so many taps are hosted on GitHub, this command is a shortcut for
#: `... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/fetch.rb | Library/Homebrew/cmd/fetch.rb | #: * `fetch` [`--force`] [`--retry`] [`-v`] [`--devel`|`--HEAD`] [`--deps`] [`--build-from-source`|`--force-bottle`] <formulae>:
#: Download the source packages for the given <formulae>.
#: For tarballs, also print SHA-256 checksums.
#:
#: If `--HEAD` or `--devel` is passed, fetch that version instead of the
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/unpin.rb | Library/Homebrew/cmd/unpin.rb | #: * `unpin` <formulae>:
#: Unpin <formulae>, allowing them to be upgraded by `brew upgrade` <formulae>.
#: See also `pin`.
require "formula"
require "cli_parser"
module Homebrew
module_function
def unpin_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`unpin` <formulae>
U... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/unpack.rb | Library/Homebrew/cmd/unpack.rb | #: * `unpack` [`--git`|`--patch`] [`--destdir=`<path>] <formulae>:
#: Unpack the source files for <formulae> into subdirectories of the current
#: working directory. If `--destdir=`<path> is given, the subdirectories will
#: be created in the directory named by <path> instead.
#:
#: If `--patch` is passed,... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/unlink.rb | Library/Homebrew/cmd/unlink.rb | #: * `unlink` [`--dry-run`] <formula>:
#: Remove symlinks for <formula> from the Homebrew prefix. This can be useful
#: for temporarily disabling a formula:
#: `brew unlink` <formula> `&&` <commands> `&& brew link` <formula>
#:
#: If `--dry-run` or `-n` is passed, Homebrew will list all files which would
#... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/commands.rb | Library/Homebrew/cmd/commands.rb | #: * `commands` [`--quiet` [`--include-aliases`]]:
#: Show a list of built-in and external commands.
#:
#: If `--quiet` is passed, list only the names of commands without the header.
#: With `--include-aliases`, the aliases of internal commands will be included.
require "cli_parser"
module Homebrew
module... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/deps.rb | Library/Homebrew/cmd/deps.rb | #: * `deps` [`--1`] [`-n`] [`--union`] [`--full-name`] [`--installed`] [`--include-build`] [`--include-optional`] [`--skip-recommended`] [`--include-requirements`] <formulae>:
#: Show dependencies for <formulae>. When given multiple formula arguments,
#: show the intersection of dependencies for <formulae>.
#:
#... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/--version.rb | Library/Homebrew/cmd/--version.rb | #: * `--version`:
#: Print the version number of Homebrew to standard output and exit.
module Homebrew
module_function
def __version
odie "This command does not take arguments." if ARGV.any?
puts "Homebrew #{HOMEBREW_VERSION}"
puts "#{CoreTap.instance.slug} #{CoreTap.instance.version_string}"
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/list.rb | Library/Homebrew/cmd/list.rb | #: * `list`, `ls` [`--full-name`] [`-1`] [`-l`] [`-t`] [`-r`]:
#: List all installed formulae. If `--full-name` is passed, print formulae
#: with fully-qualified names. If `--full-name` is not passed, other
#: options (i.e. `-1`, `-l`, `-t` and `-r`) are passed to `ls` which produces the actual output.
#:
#: ... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/config.rb | Library/Homebrew/cmd/config.rb | #: * `config`:
#: Show Homebrew and system configuration useful for debugging. If you file
#: a bug report, you will likely be asked for this information if you do not
#: provide it.
require "system_config"
require "cli_parser"
module Homebrew
module_function
def config_args
Homebrew::CLI::Parser.n... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/cask.rb | Library/Homebrew/cmd/cask.rb | require "cask/all"
module Homebrew
module_function
def cask
Cask::Cmd.run(*ARGV)
end
end
| ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/tap-pin.rb | Library/Homebrew/cmd/tap-pin.rb | #: * `tap-pin` <tap>:
#: Pin <tap>, prioritizing its formulae over core when formula names are supplied
#: by the user. See also `tap-unpin`.
require "cli_parser"
module Homebrew
module_function
def tap_pin_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`tap-pin` <tap>
Pi... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/switch.rb | Library/Homebrew/cmd/switch.rb | #: * `switch` <formula> <version>:
#: Symlink all of the specific <version> of <formula>'s install to Homebrew prefix.
require "formula"
require "keg"
require "cli_parser"
module Homebrew
module_function
def switch_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`switch` <formula> <ve... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/analytics.rb | Library/Homebrew/cmd/analytics.rb | #: * `analytics` [`state`]:
#: Display anonymous user behaviour analytics state.
#: Read more at <https://docs.brew.sh/Analytics>.
#:
#: * `analytics` (`on`|`off`):
#: Turn on/off Homebrew's analytics.
#:
#: * `analytics` `regenerate-uuid`:
#: Regenerate UUID used in Homebrew's analytics.
require "cli_p... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/install.rb | Library/Homebrew/cmd/install.rb | #: * `install` [`--debug`] [`--env=`(`std`|`super`)] [`--ignore-dependencies`|`--only-dependencies`] [`--cc=`<compiler>] [`--build-from-source`|`--force-bottle`] [`--include-test`] [`--devel`|`--HEAD`] [`--keep-tmp`] [`--build-bottle`] [`--force`] [`--verbose`] [`--display-times`] <formula> [<options> ...]:
#: Inst... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/sh.rb | Library/Homebrew/cmd/sh.rb | #: * `sh` [`--env=std`]:
#: Start a Homebrew build environment shell. Uses our years-battle-hardened
#: Homebrew build logic to help your `./configure && make && make install`
#: or even your `gem install` succeed. Especially handy if you run Homebrew
#: in an Xcode-only configuration since it adds tools l... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/--cellar.rb | Library/Homebrew/cmd/--cellar.rb | #: * `--cellar`:
#: Display Homebrew's Cellar path. *Default:* `$(brew --prefix)/Cellar`, or if
#: that directory doesn't exist, `$(brew --repository)/Cellar`.
#:
#: * `--cellar` <formula>:
#: Display the location in the cellar where <formula> would be installed,
#: without any sort of versioned directory... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/style.rb | Library/Homebrew/cmd/style.rb | #: * `style` [`--fix`] [`--display-cop-names`] [`--only-cops=`<cops>|`--except-cops=`<cops>] [<files>|<taps>|<formulae>]:
#: Check formulae or files for conformance to Homebrew style guidelines.
#:
#: Lists of <files>, <taps> and <formulae> may not be combined. If none are
#: provided, `style` will run style ... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/leaves.rb | Library/Homebrew/cmd/leaves.rb | #: * `leaves`:
#: Show installed formulae that are not dependencies of another installed formula.
require "formula"
require "tab"
require "cli_parser"
module Homebrew
module_function
def leaves_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`leaves`
Show installed formulae t... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/cmd/cat.rb | Library/Homebrew/cmd/cat.rb | #: * `cat` <formula>:
#: Display the source to <formula>.
require "cli_parser"
module Homebrew
module_function
def cat_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`cat` <formula>
Display the source to <formula>.
EOS
end
end
def cat
cat_args.parse
# ... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/bundler/setup.rb | Library/Homebrew/vendor/bundle-standalone/bundler/setup.rb | require 'rbconfig'
# ruby 1.8.7 doesn't define RUBY_ENGINE
ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
ruby_version = RbConfig::CONFIG["ruby_version"]
path = File.expand_path('..', __FILE__)
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/concurrent-ruby-1.1.4/lib"
$:.unshift "#{path}/../#{rub... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop-rspec.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop-rspec.rb | require 'pathname'
require 'yaml'
require 'rubocop'
require_relative 'rubocop/rspec'
require_relative 'rubocop/rspec/version'
require_relative 'rubocop/rspec/inject'
require_relative 'rubocop/rspec/node'
require_relative 'rubocop/rspec/top_level_describe'
require_relative 'rubocop/rspec/wording'
require_relative 'rub... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec.rb | module RuboCop
# RuboCop RSpec project namespace
module RSpec
PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'default.yml').freeze
CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
private_constant(:CONFIG_DEFAULT, :PRO... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/language.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/language.rb | # frozen_string_literal: true
module RuboCop
module RSpec
# RSpec public API methods that are commonly used in cops
module Language
# Set of method selectors
class SelectorSet
def initialize(selectors)
@selectors = selectors
end
def ==(other)
selectors... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/version.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/version.rb | # frozen_string_literal: true
module RuboCop
module RSpec
# Version information for the RSpec RuboCop plugin.
module Version
STRING = '1.31.0'.freeze
end
end
end
| ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/blank_line_separation.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/blank_line_separation.rb | module RuboCop
module RSpec
# Helps determine the offending location if there is not a blank line
# following the node. Allows comments to follow directly after.
module BlankLineSeparation
include FinalEndLocation
include RuboCop::Cop::RangeHelp
def missing_separating_line(node)
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/final_end_location.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/final_end_location.rb | module RuboCop
module RSpec
# Helps find the true end location of nodes which might contain heredocs.
module FinalEndLocation
def final_end_location(start_node)
heredoc_endings =
start_node.each_node(:str, :dstr, :xstr)
.select(&:heredoc?)
.map { |node| node.loc... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/node.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/node.rb | # frozen_string_literal: true
module RuboCop
module RSpec
# RuboCop-RSpec specific extensions of RuboCop::AST::Node
module Node
# In various cops we want to regard const as literal althought it's not
# strictly literal.
def recursive_literal_or_const?
case type
when :begin, ... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/description_extractor.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/description_extractor.rb | module RuboCop
module RSpec
# Extracts cop descriptions from YARD docstrings
class DescriptionExtractor
def initialize(yardocs)
@code_objects = yardocs.map(&CodeObject.public_method(:new))
end
def to_h
code_objects
.select(&:rspec_cop?)
.map(&:configurati... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/wording.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/wording.rb | # frozen_string_literal: true
module RuboCop
module RSpec
# RSpec example wording rewriter
class Wording
SHOULDNT_PREFIX = /\Ashould(?:n't| not)\b/i.freeze
SHOULDNT_BE_PREFIX = /#{SHOULDNT_PREFIX} be\b/i.freeze
ES_SUFFIX_PATTERN = /(?:o|s|x|ch|sh|z)\z/i.freeze
IES_SUFFIX_PATTERN =... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/hook.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/hook.rb | # frozen_string_literal: true
module RuboCop
module RSpec
# Wrapper for RSpec hook
class Hook < Concept
STANDARDIZED_SCOPES = %i[each context suite].freeze
private_constant(:STANDARDIZED_SCOPES)
def name
node.method_name
end
def knowable_scope?
return true unle... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/example_group.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/example_group.rb | # frozen_string_literal: true
module RuboCop
module RSpec
# Wrapper for RSpec example groups
class ExampleGroup < Concept
# @!method scope_change?(node)
#
# Detect if the node is an example group or shared example
#
# Selectors which indicate that we should stop searching
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/concept.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/concept.rb | # frozen_string_literal: true
module RuboCop
module RSpec
# Wrapper for RSpec DSL methods
class Concept
include Language
include Language::NodePattern
extend NodePattern::Macros
def initialize(node)
@node = node
end
def eql?(other)
node == other.node
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/example.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/example.rb | # frozen_string_literal: true
module RuboCop
module RSpec
# Wrapper for RSpec examples
class Example < Concept
def_node_matcher :extract_doc_string, '(send _ _ $str ...)'
def_node_matcher :extract_metadata, '(send _ _ _ $...)'
def_node_matcher :extract_implementation, '(block send... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/align_let_brace.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/align_let_brace.rb | # frozen_string_literal: true
module RuboCop
module RSpec
# Shared behavior for aligning braces for single line lets
class AlignLetBrace
include RuboCop::RSpec::Language::NodePattern
def initialize(root, token)
@root = root
@token = token
end
def offending_tokens
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/config_formatter.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/config_formatter.rb | require 'yaml'
module RuboCop
module RSpec
# Builds a YAML config file from two config hashes
class ConfigFormatter
NAMESPACES = /^(RSpec|Capybara|FactoryBot|Rails)/.freeze
STYLE_GUIDE_BASE_URL = 'http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/'.freeze
def initialize(config, ... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/inject.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/inject.rb | module RuboCop
module RSpec
# Because RuboCop doesn't yet support plugins, we have to monkey patch in a
# bit of our configuration.
module Inject
def self.defaults!
path = CONFIG_DEFAULT.to_s
hash = ConfigLoader.send(:load_yaml_configuration, path)
config = Config.new(hash, p... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/top_level_describe.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/top_level_describe.rb | module RuboCop
module RSpec
# Helper methods for top level describe cops
module TopLevelDescribe
extend NodePattern::Macros
def_node_matcher :described_constant, <<-PATTERN
(block $(send _ :describe $(const ...)) (args) $_)
PATTERN
def on_send(node)
return unless resp... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/util.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/util.rb | # frozen_string_literal: true
module RuboCop
module RSpec
# Utility methods
module Util
# Error raised by `Util.one` if size is less than zero or greater than one
SizeError = Class.new(IndexError)
# Return only element in array if it contains exactly one member
def one(array)
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/language/node_pattern.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/rspec/language/node_pattern.rb | # frozen_string_literal: true
module RuboCop
module RSpec
module Language
# Common node matchers used for matching against the rspec DSL
module NodePattern
extend RuboCop::NodePattern::Macros
def_node_matcher :example_group?, ExampleGroups::ALL.block_pattern
def_node_matcher... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec_cops.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec_cops.rb | require_relative 'rspec/capybara/current_path_expectation'
require_relative 'rspec/capybara/feature_methods'
require_relative 'rspec/factory_bot/attribute_defined_statically'
require_relative 'rspec/factory_bot/create_list'
begin
require_relative 'rspec/rails/http_status'
rescue LoadError # rubocop:disable Lint/Han... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/subject_stub.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/subject_stub.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for stubbed test subjects.
#
# @see https://robots.thoughtbot.com/don-t-stub-the-system-under-test
#
# @example
# # bad
# describe Foo do
# subject(:bar) { baz }
#
# ... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/overwriting_setup.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/overwriting_setup.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks if there is a let/subject that overwrites an existing one.
#
# @example
# # bad
# let(:foo) { bar }
# let(:foo) { baz }
#
# subject(:foo) { bar }
# let(:foo) { baz }
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/empty_line_after_final_let.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/empty_line_after_final_let.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks if there is an empty line after the last let block.
#
# @example
# # bad
# let(:foo) { bar }
# let(:something) { other }
# it { does_something }
#
# # good
# let(:... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/multiple_describes.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/multiple_describes.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for multiple top level describes.
#
# Multiple descriptions for the same class or module should either
# be nested or separated into different test files.
#
# @example
# # bad
# descr... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/verified_doubles.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/verified_doubles.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Prefer using verifying doubles over normal doubles.
#
# @see https://relishapp.com/rspec/rspec-mocks/docs/verifying-doubles
#
# @example
# # bad
# let(:foo) do
# double(method_name: 'ret... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/cop.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/cop.rb | # frozen_string_literal: true
module RuboCop
module Cop # rubocop:disable Style/Documentation
WorkaroundCop = Cop.dup
# Clone of the the normal RuboCop::Cop::Cop class so we can rewrite
# the inherited method without breaking functionality
class WorkaroundCop
# Remove the Cop.inherited method ... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/predicate_matcher.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/predicate_matcher.rb | module RuboCop
module Cop
module RSpec
# A helper for `inflected` style
module InflectedHelper
extend NodePattern::Macros
MSG_INFLECTED = 'Prefer using `%<matcher_name>s` matcher over ' \
'`%<predicate_name>s`.'.freeze
private
def check_inflec... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/describe_symbol.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/describe_symbol.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Avoid describing symbols.
#
# @example
# # bad
# describe :my_method do
# # ...
# end
#
# # good
# describe '#my_method' do
# # ...
# end
#
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/named_subject.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/named_subject.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for explicitly referenced test subjects.
#
# RSpec lets you declare an "implicit subject" using `subject { ... }`
# which allows for tests like `it { should be_valid }`. If you need to
# reference your tes... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/receive_counts.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/receive_counts.rb | module RuboCop
module Cop
module RSpec
# Check for `once` and `twice` receive counts matchers usage.
#
# @example
#
# # bad
# expect(foo).to receive(:bar).exactly(1).times
# expect(foo).to receive(:bar).exactly(2).times
# expect(foo).to receive(:bar)... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/expect_change.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/expect_change.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for consistent style of change matcher.
#
# Enforces either passing object and attribute as arguments to the matcher
# or passing a block that reads the attribute value.
#
# This cop can be configure... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/implicit_expect.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/implicit_expect.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Check that a consistent implicit expectation style is used.
#
# This cop can be configured using the `EnforcedStyle` option
# and supports the `--auto-gen-config` flag.
#
# @example `EnforcedStyle: is_expec... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/expect_in_hook.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/expect_in_hook.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Do not use `expect` in hooks such as `before`.
#
# @example
# # bad
# before do
# expect(something).to eq 'foo'
# end
#
# # bad
# after do
# expect_any_instan... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/let_setup.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/let_setup.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks unreferenced `let!` calls being used for test setup.
#
# @example
# # Bad
# let!(:my_widget) { create(:widget) }
#
# it 'counts widgets' do
# expect(Widget.count).to eq(1)
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/repeated_example.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/repeated_example.rb | module RuboCop
module Cop
module RSpec
# Check for repeated examples within example groups.
#
# @example
#
# it 'is valid' do
# expect(user).to be_valid
# end
#
# it 'validates the user' do
# expect(user).to be_valid
# end
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/message_spies.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/message_spies.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks that message expectations are set using spies.
#
# This cop can be configured in your configuration using the
# `EnforcedStyle` option and supports `--auto-gen-config`.
#
# @example `EnforcedStyle: h... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/describe_method.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/describe_method.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks that the second argument to `describe` specifies a method.
#
# @example
# # bad
# describe MyClass, 'do something' do
# end
#
# # good
# describe MyClass, '#my_instance_me... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/described_class.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/described_class.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks that tests use `described_class`.
#
# If the first argument of describe is a class, the class is exposed to
# each example via described_class.
#
# This cop can be configured using the `EnforcedStyle... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/message_expectation.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/message_expectation.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for consistent message expectation style.
#
# This cop can be configured in your configuration using the
# `EnforcedStyle` option and supports `--auto-gen-config`.
#
# @example `EnforcedStyle: allow`... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/multiple_subjects.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/multiple_subjects.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks if an example group defines `subject` multiple times.
#
# @example
#
# # bad
# describe Foo do
# subject(:user) { User.new }
# subject(:post) { Post.new }
# end
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/context_wording.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/context_wording.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# `context` block descriptions should start with 'when', or 'with'.
#
# @see https://github.com/reachlocal/rspec-style-guide#context-descriptions
# @see http://www.betterspecs.org/#contexts
#
# @example `Pref... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/implicit_subject.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/implicit_subject.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for usage of implicit subject (`is_expected` / `should`).
#
# This cop can be configured using the `EnforcedStyle` option
#
# @example `EnforcedStyle: single_line_only`
# # bad
# it do
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/not_to_not.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/not_to_not.rb | module RuboCop
module Cop
module RSpec
# Checks for consistent method usage for negating expectations.
#
# @example
# # bad
# it '...' do
# expect(false).to_not be_true
# end
#
# # good
# it '...' do
# expect(false).not_to be_true... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/return_from_stub.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/return_from_stub.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for consistent style of stub's return setting.
#
# Enforces either `and_return` or block-style return in the cases
# where the returned value is constant. Ignores dynamic returned values
# are the result w... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/instance_variable.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/instance_variable.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for instance variable usage in specs.
#
# This cop can be configured with the option `AssignmentOnly` which
# will configure the cop to only register offenses on instance
# variable usage if the instance v... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/empty_example_group.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/empty_example_group.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks if an example group does not include any tests.
#
# This cop is configurable using the `CustomIncludeMethods` option
#
# @example usage
#
# # bad
# describe Bacon do
# let(:... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/nested_groups.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/nested_groups.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for nested example groups.
#
# This cop is configurable using the `Max` option
# and supports `--auto-gen-config
#
# @example
# # bad
# context 'when using some feature' do
# ... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/instance_spy.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/instance_spy.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for `instance_double` used with `have_received`.
#
# @example
# # bad
# it do
# foo = instance_double(Foo).as_null_object
# expect(foo).to have_received(:bar)
# end
#
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/expect_output.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/expect_output.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for opportunities to use `expect { ... }.to output`.
#
# @example
# # bad
# $stdout = StringIO.new
# my_app.print_report
# $stdout = STDOUT
# expect($stdout.string).to eq('Hello... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/receive_never.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/receive_never.rb | module RuboCop
module Cop
module RSpec
# Prefer `not_to receive(...)` over `receive(...).never`.
#
# @example
#
# # bad
# expect(foo).to receive(:bar).never
#
# # good
# expect(foo).not_to receive(:bar)
#
class ReceiveNever < Cop
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/scattered_setup.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/scattered_setup.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for setup scattered across multiple hooks in an example group.
#
# Unify `before`, `after`, and `around` hooks when possible.
#
# @example
# # bad
# describe Foo do
# before { set... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/empty_line_after_subject.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/empty_line_after_subject.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks if there is an empty line after subject block.
#
# @example
# # bad
# subject(:obj) { described_class }
# let(:foo) { bar }
#
# # good
# subject(:obj) { described_class }
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/single_argument_message_chain.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/single_argument_message_chain.rb | module RuboCop
module Cop
module RSpec
# Checks that chains of messages contain more than one element.
#
# @example
# # bad
# allow(foo).to receive_message_chain(:bar).and_return(42)
#
# # good
# allow(foo).to receive(:bar).and_return(42)
#
# #... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/message_chain.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/message_chain.rb | module RuboCop
module Cop
module RSpec
# Check that chains of messages are not being stubbed.
#
# @example
# # bad
# allow(foo).to receive_message_chain(:bar, :baz).and_return(42)
#
# # better
# thing = Thing.new(baz: 42)
# allow(foo).to receive(bar:... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/shared_examples.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/shared_examples.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Enforces use of string to titleize shared examples.
#
# @example
# # bad
# it_behaves_like :foo_bar_baz
# it_should_behave_like :foo_bar_baz
# shared_examples :foo_bar_baz
# shared_exa... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/empty_line_after_hook.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/empty_line_after_hook.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks if there is an empty line after hook blocks.
#
# @example
# # bad
# before { do_something }
# it { does_something }
#
# # bad
# after { do_something }
# it { does_... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/multiple_expectations.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/multiple_expectations.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks if examples contain too many `expect` calls.
#
# @see http://betterspecs.org/#single Single expectation test
#
# This cop is configurable using the `Max` option
# and works with `--auto-gen-config`.
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/shared_context.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/shared_context.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for proper shared_context and shared_examples usage.
#
# If there are no examples defined, use shared_context.
# If there is no setup defined, use shared_examples.
#
# @example
# # bad
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/empty_line_after_example_group.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/empty_line_after_example_group.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks if there is an empty line after example group blocks.
#
# @example
# # bad
# RSpec.describe Foo do
# describe '#bar' do
# end
# describe '#baz' do
# end
# ... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/missing_example_group_argument.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/missing_example_group_argument.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks that the first argument to an example group is not empty.
#
# @example
# # bad
# describe do
# end
#
# RSpec.describe do
# end
#
# # good
# describe ... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/invalid_predicate_matcher.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/invalid_predicate_matcher.rb | module RuboCop
module Cop
module RSpec
# Checks invalid usage for predicate matcher.
#
# Predicate matcher does not need a question.
# This cop checks an unnecessary question in predicate matcher.
#
# @example
#
# # bad
# expect(foo).to be_something?
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/file_path.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/file_path.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks that spec file paths are consistent with the test subject.
#
# Checks the path of the spec file and enforces that it reflects the
# described class/module and its optionally called out method.
#
# Wi... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/pending.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/pending.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for any pending or skipped examples.
#
# @example
# # bad
# describe MyClass do
# it "should be true"
# end
#
# describe MyClass do
# it "should be true" do
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/before_after_all.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/before_after_all.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Check that before/after(:all) isn't being used.
#
# @example
# # bad
# #
# # Faster but risk of state leaking between examples
# #
# describe MyClass do
# before(:all) { Widg... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/around_block.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/around_block.rb | module RuboCop
module Cop
module RSpec
# Checks that around blocks actually run the test.
#
# @example
# # bad
# around do
# some_method
# end
#
# around do |test|
# some_method
# end
#
# # good
# around do |... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/be_eql.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/be_eql.rb | module RuboCop
module Cop
module RSpec
# Check for expectations where `be(...)` can replace `eql(...)`.
#
# The `be` matcher compares by identity while the `eql` matcher
# compares using `eql?`. Integers, floats, booleans, symbols, and nil
# can be compared by identity and therefore ... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/align_right_let_brace.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/align_right_let_brace.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks that right braces for adjacent single line lets are aligned.
#
# @example
#
# # bad
# let(:foobar) { blahblah }
# let(:baz) { bar }
# let(:a) { b }
#
#... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/describe_class.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/describe_class.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Check that the first argument to the top level describe is a constant.
#
# @example
# # bad
# describe 'Do something' do
# end
#
# # good
# describe TestedClass do
# end
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/it_behaves_like.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/it_behaves_like.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks that only one `it_behaves_like` style is used.
#
# @example when configuration is `EnforcedStyle: it_behaves_like`
# # bad
# it_should_behave_like 'a foo'
#
# # good
# it_behaves_... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/void_expect.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/void_expect.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# This cop checks void `expect()`.
#
# @example
# # bad
# expect(something)
#
# # good
# expect(something).to be(1)
class VoidExpect < Cop
MSG = 'Do not use `expect()` withou... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/example_without_description.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/example_without_description.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for examples without a description.
#
# RSpec allows for auto-generated example descriptions when there is no
# description provided or the description is an empty one.
#
# This cop removes empty des... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/scattered_let.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/scattered_let.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for let scattered across the example group.
#
# Group lets together
#
# @example
# # bad
# describe Foo do
# let(:foo) { 1 }
# subject { Foo }
# let(:bar) { 2 ... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/hooks_before_examples.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/hooks_before_examples.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for before/around/after hooks that come after an example.
#
# @example
# # Bad
#
# it 'checks what foo does' do
# expect(foo).to be
# end
#
# before { prepare }
... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/example_wording.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/example_wording.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks for common mistakes in example descriptions.
#
# This cop will correct docstrings that begin with 'should' and 'it'.
#
# @see http://betterspecs.org/#should
#
# The autocorrect is experimental ... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/align_left_let_brace.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/align_left_let_brace.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
# Checks that left braces for adjacent single line lets are aligned.
#
# @example
#
# # bad
# let(:foobar) { blahblah }
# let(:baz) { bar }
# let(:a) { b }
#
# # go... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/any_instance.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/any_instance.rb | module RuboCop
module Cop
module RSpec
# Check that instances are not being stubbed globally.
#
# Prefer instance doubles over stubbing any instance of a class
#
# @example
# # bad
# describe MyClass do
# before { allow_any_instance_of(MyClass).to receive(:f... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Linuxbrew/brew | https://github.com/Linuxbrew/brew/blob/93389fde63974f096156344e281610acec44130c/Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/repeated_description.rb | Library/Homebrew/vendor/bundle-standalone/ruby/2.3.0/gems/rubocop-rspec-1.31.0/lib/rubocop/cop/rspec/repeated_description.rb | module RuboCop
module Cop
module RSpec
# Check for repeated description strings in example groups.
#
# @example
#
# # bad
# RSpec.describe User do
# it 'is valid' do
# # ...
# end
#
# it 'is valid' do
# ... | ruby | BSD-2-Clause | 93389fde63974f096156344e281610acec44130c | 2026-01-04T15:53:38.399858Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.