How to use its method of RuboCop.Cop.RSpec Package

Best Test-prof_ruby code snippet using RuboCop.Cop.RSpec.its

rubocop-rspec@2.12.1.rbi

Source:rubocop-rspec@2.12.1.rbi Github

copy

Full Screen

...816# This cop can be configured using the `EnforcedStyle` and `SkipBlocks`817# options.818#819# There's a known caveat with rspec-rails's `controller` helper that820# runs its block in a different context, and `described_class` is not821# available to it. `SkipBlocks` option excludes detection in all822# non-RSpec related blocks.823#824# To narrow down this setting to only a specific directory, it is825# possible to use an overriding configuration file local to that826# directory.827#828# @example `EnforcedStyle: described_class` (default)829# # bad830# describe MyClass do831# subject { MyClass.do_something }832# end833#834# # good835# describe MyClass do836# subject { described_class.do_something }837# end838# @example `EnforcedStyle: explicit`839# # bad840# describe MyClass do841# subject { described_class.do_something }842# end843#844# # good845# describe MyClass do846# subject { MyClass.do_something }847# end848# @example `SkipBlocks: true`849# # spec/controllers/.rubocop.yml850# # RSpec/DescribedClass:851# # SkipBlocks: true852#853# # acceptable854# describe MyConcern do855# controller(ApplicationController) do856# include MyConcern857# end858# end859#860# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:57861class RuboCop::Cop::RSpec::DescribedClass < ::RuboCop::Cop::RSpec::Base862 include ::RuboCop::Cop::ConfigurableEnforcedStyle863 extend ::RuboCop::Cop::AutoCorrector864 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:65865 def common_instance_exec_closure?(param0 = T.unsafe(nil)); end866 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:81867 def contains_described_class?(param0); end868 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:76869 def described_constant(param0 = T.unsafe(nil)); end870 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:84871 def on_block(node); end872 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:70873 def rspec_block?(param0 = T.unsafe(nil)); end874 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:73875 def scope_changing_syntax?(param0 = T.unsafe(nil)); end876 private877 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:101878 def autocorrect(corrector, match); end879 # @example880 # # nil represents base constant881 # collapse_namespace([], [:C]) # => [:C]882 # collapse_namespace([:A, :B], [:C]) # => [:A, :B, :C]883 # collapse_namespace([:A, :B], [:B, :C]) # => [:A, :B, :C]884 # collapse_namespace([:A, :B], [nil, :C]) # => [nil, :C]885 # collapse_namespace([:A, :B], [nil, :B, :C]) # => [nil, :B, :C]886 # @param namespace [Array<Symbol>]887 # @param const [Array<Symbol>]888 # @return [Array<Symbol>]889 #890 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:176891 def collapse_namespace(namespace, const); end892 # @example893 # const_name(s(:const, nil, :C)) # => [:C]894 # const_name(s(:const, s(:const, nil, :M), :C)) # => [:M, :C]895 # const_name(s(:const, s(:cbase), :C)) # => [nil, :C]896 # @param node [RuboCop::AST::Node]897 # @return [Array<Symbol>]898 #899 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:193900 def const_name(node); end901 # @yield [node]902 #903 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:111904 def find_usage(node, &block); end905 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:162906 def full_const_name(node); end907 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:121908 def message(offense); end909 # @example910 # namespace(node) # => [:A, :B, :C]911 # @param node [RuboCop::AST::Node]912 # @return [Array<Symbol>]913 #914 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:208915 def namespace(node); end916 # @return [Boolean]917 #918 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:140919 def offensive?(node); end920 # @return [Boolean]921 #922 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:148923 def offensive_described_class?(node); end924 # @return [Boolean]925 #926 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:130927 def scope_change?(node); end928 # @return [Boolean]929 #930 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:136931 def skippable_block?(node); end932end933# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:61934RuboCop::Cop::RSpec::DescribedClass::DESCRIBED_CLASS = T.let(T.unsafe(nil), String)935# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class.rb:62936RuboCop::Cop::RSpec::DescribedClass::MSG = T.let(T.unsafe(nil), String)937# Avoid opening modules and defining specs within them.938#939# @example940# # bad941# module MyModule942# RSpec.describe MyClass do943# # ...944# end945# end946#947# # good948# RSpec.describe MyModule::MyClass do949# # ...950# end951# @see https://github.com/rubocop/rubocop-rspec/issues/735952#953# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class_module_wrapping.rb:22954class RuboCop::Cop::RSpec::DescribedClassModuleWrapping < ::RuboCop::Cop::RSpec::Base955 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class_module_wrapping.rb:26956 def find_rspec_blocks(param0); end957 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class_module_wrapping.rb:28958 def on_module(node); end959end960# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/described_class_module_wrapping.rb:23961RuboCop::Cop::RSpec::DescribedClassModuleWrapping::MSG = T.let(T.unsafe(nil), String)962# Enforces custom RSpec dialects.963#964# A dialect can be based on the following RSpec methods:965#966# - describe, context, feature, example_group967# - xdescribe, xcontext, xfeature968# - fdescribe, fcontext, ffeature969# - shared_examples, shared_examples_for, shared_context970# - it, specify, example, scenario, its971# - fit, fspecify, fexample, fscenario, focus972# - xit, xspecify, xexample, xscenario, skip973# - pending974# - prepend_before, before, append_before,975# - around976# - prepend_after, after, append_after977# - let, let!978# - subject, subject!979# - expect, is_expected, expect_any_instance_of980#981# By default all of the RSpec methods and aliases are allowed. By setting982# a config like:983#984# RSpec/Dialect:985# PreferredMethods:986# context: describe987#988# You can expect the following behavior:989#990# @example991# # bad992# context 'display name presence' do993# # ...994# end995#996# # good997# describe 'display name presence' do998# # ...999# end1000#1001# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/dialect.rb:441002class RuboCop::Cop::RSpec::Dialect < ::RuboCop::Cop::RSpec::Base1003 include ::RuboCop::Cop::MethodPreference1004 extend ::RuboCop::Cop::AutoCorrector1005 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/dialect.rb:531006 def on_send(node); end1007 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/dialect.rb:511008 def rspec_method?(param0 = T.unsafe(nil)); end1009end1010# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/dialect.rb:481011RuboCop::Cop::RSpec::Dialect::MSG = T.let(T.unsafe(nil), String)1012# Checks if an example group does not include any tests.1013#1014# @example usage1015#1016# # bad1017# describe Bacon do1018# let(:bacon) { Bacon.new(chunkiness) }1019# let(:chunkiness) { false }1020#1021# context 'extra chunky' do # flagged by rubocop1022# let(:chunkiness) { true }1023# end1024#1025# it 'is chunky' do1026# expect(bacon.chunky?).to be_truthy1027# end1028# end1029#1030# # good1031# describe Bacon do1032# let(:bacon) { Bacon.new(chunkiness) }1033# let(:chunkiness) { false }1034#1035# it 'is chunky' do1036# expect(bacon.chunky?).to be_truthy1037# end1038# end1039#1040# # good1041# describe Bacon do1042# pending 'will add tests later'1043# end1044#1045# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_example_group.rb:381046class RuboCop::Cop::RSpec::EmptyExampleGroup < ::RuboCop::Cop::RSpec::Base1047 # Match example group blocks and yield their body1048 #1049 # @example source that matches1050 # describe 'example group' do1051 # it { is_expected.to be }1052 # end1053 # @param node [RuboCop::AST::Node]1054 # @yield [RuboCop::AST::Node] example group body1055 #1056 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_example_group.rb:511057 def example_group_body(param0 = T.unsafe(nil)); end1058 # Match examples, example groups and includes1059 #1060 # @example source that matches1061 # it { is_expected.to fly }1062 # describe('non-empty example groups too') { }1063 # it_behaves_like 'an animal'1064 # it_behaves_like('a cat') { let(:food) { 'milk' } }1065 # it_has_root_access1066 # skip1067 # it 'will be implemented later'1068 # @param node [RuboCop::AST::Node]1069 # @return [Array<RuboCop::AST::Node>] matching nodes1070 #1071 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_example_group.rb:691072 def example_or_group_or_include?(param0 = T.unsafe(nil)); end1073 # Matches examples defined in scopes where they could run1074 #1075 # @example source that matches1076 # it { expect(myself).to be_run }1077 # describe { it { i_run_as_well } }1078 # @example source that does not match1079 # before { it { whatever here wont run anyway } }1080 # @param node [RuboCop::AST::Node]1081 # @return [Array<RuboCop::AST::Node>] matching nodes1082 #1083 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_example_group.rb:1261084 def examples?(param0 = T.unsafe(nil)); end1085 # Match examples or examples inside blocks1086 #1087 # @example source that matches1088 # it { expect(drink).to be_cold }1089 # context('when winter') { it { expect(drink).to be_hot } }1090 # (1..5).each { |divisor| it { is_expected.to divide_by(divisor) } }1091 # @param node [RuboCop::AST::Node]1092 # @return [Array<RuboCop::AST::Node>] matching nodes1093 #1094 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_example_group.rb:1071095 def examples_directly_or_in_block?(param0 = T.unsafe(nil)); end1096 # Match examples defined inside a block which is not a hook1097 #1098 # @example source that matches1099 # %w(r g b).each do |color|1100 # it { is_expected.to have_color(color) }1101 # end1102 # @example source that does not match1103 # before do1104 # it { is_expected.to fall_into_oblivion }1105 # end1106 # @param node [RuboCop::AST::Node]1107 # @return [Array<RuboCop::AST::Node>] matching nodes1108 #1109 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_example_group.rb:931110 def examples_inside_block?(param0 = T.unsafe(nil)); end1111 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_example_group.rb:1331112 def on_block(node); end1113 private1114 # @return [Boolean]1115 #1116 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_example_group.rb:1551117 def conditionals_with_examples?(body); end1118 # @return [Boolean]1119 #1120 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_example_group.rb:1631121 def examples_in_branches?(condition_node); end1122 # @return [Boolean]1123 #1124 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_example_group.rb:1441125 def offensive?(body); end1126end1127# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_example_group.rb:391128RuboCop::Cop::RSpec::EmptyExampleGroup::MSG = T.let(T.unsafe(nil), String)1129# Checks for empty before and after hooks.1130#1131# @example1132# # bad1133# before {}1134# after do; end1135# before(:all) do1136# end1137# after(:all) { }1138#1139# # good1140# before { create_users }1141# after do1142# cleanup_users1143# end1144# before(:all) do1145# create_feed1146# end1147# after(:all) { cleanup_feed }1148#1149# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_hook.rb:251150class RuboCop::Cop::RSpec::EmptyHook < ::RuboCop::Cop::RSpec::Base1151 include ::RuboCop::Cop::RangeHelp1152 extend ::RuboCop::Cop::AutoCorrector1153 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_hook.rb:321154 def empty_hook?(param0 = T.unsafe(nil)); end1155 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_hook.rb:361156 def on_block(node); end1157end1158# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_hook.rb:291159RuboCop::Cop::RSpec::EmptyHook::MSG = T.let(T.unsafe(nil), String)1160# Checks if there is an empty line after example blocks.1161#1162# @example1163# # bad1164# RSpec.describe Foo do1165# it 'does this' do1166# end1167# it 'does that' do1168# end1169# end1170#1171# # good1172# RSpec.describe Foo do1173# it 'does this' do1174# end1175#1176# it 'does that' do1177# end1178# end1179#1180# # fair - it's ok to have non-separated one-liners1181# RSpec.describe Foo do1182# it { one }1183# it { two }1184# end1185# @example with AllowConsecutiveOneLiners configuration1186#1187# # rubocop.yml1188# # RSpec/EmptyLineAfterExample:1189# # AllowConsecutiveOneLiners: false1190#1191# # bad1192# RSpec.describe Foo do1193# it { one }1194# it { two }1195# end1196#1197# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example.rb:441198class RuboCop::Cop::RSpec::EmptyLineAfterExample < ::RuboCop::Cop::RSpec::Base1199 include ::RuboCop::Cop::RSpec::FinalEndLocation1200 include ::RuboCop::Cop::RangeHelp1201 include ::RuboCop::Cop::RSpec::EmptyLineSeparation1202 extend ::RuboCop::Cop::AutoCorrector1203 # @return [Boolean]1204 #1205 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example.rb:631206 def allow_consecutive_one_liners?; end1207 # @return [Boolean]1208 #1209 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example.rb:591210 def allowed_one_liner?(node); end1211 # @return [Boolean]1212 #1213 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example.rb:671214 def consecutive_one_liner?(node); end1215 # @return [Boolean]1216 #1217 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example.rb:711218 def next_one_line_example?(node); end1219 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example.rb:791220 def next_sibling(node); end1221 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example.rb:501222 def on_block(node); end1223end1224# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example.rb:481225RuboCop::Cop::RSpec::EmptyLineAfterExample::MSG = T.let(T.unsafe(nil), String)1226# Checks if there is an empty line after example group blocks.1227#1228# @example1229# # bad1230# RSpec.describe Foo do1231# describe '#bar' do1232# end1233# describe '#baz' do1234# end1235# end1236#1237# # good1238# RSpec.describe Foo do1239# describe '#bar' do1240# end1241#1242# describe '#baz' do1243# end1244# end1245#1246# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example_group.rb:261247class RuboCop::Cop::RSpec::EmptyLineAfterExampleGroup < ::RuboCop::Cop::RSpec::Base1248 include ::RuboCop::Cop::RSpec::FinalEndLocation1249 include ::RuboCop::Cop::RangeHelp1250 include ::RuboCop::Cop::RSpec::EmptyLineSeparation1251 extend ::RuboCop::Cop::AutoCorrector1252 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example_group.rb:321253 def on_block(node); end1254end1255# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_example_group.rb:301256RuboCop::Cop::RSpec::EmptyLineAfterExampleGroup::MSG = T.let(T.unsafe(nil), String)1257# Checks if there is an empty line after the last let block.1258#1259# @example1260# # bad1261# let(:foo) { bar }1262# let(:something) { other }1263# it { does_something }1264#1265# # good1266# let(:foo) { bar }1267# let(:something) { other }1268#1269# it { does_something }1270#1271# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_final_let.rb:191272class RuboCop::Cop::RSpec::EmptyLineAfterFinalLet < ::RuboCop::Cop::RSpec::Base1273 include ::RuboCop::Cop::RSpec::FinalEndLocation1274 include ::RuboCop::Cop::RangeHelp1275 include ::RuboCop::Cop::RSpec::EmptyLineSeparation1276 extend ::RuboCop::Cop::AutoCorrector1277 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_final_let.rb:251278 def on_block(node); end1279end1280# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_final_let.rb:231281RuboCop::Cop::RSpec::EmptyLineAfterFinalLet::MSG = T.let(T.unsafe(nil), String)1282# Checks if there is an empty line after hook blocks.1283#1284# @example1285# # bad1286# before { do_something }1287# it { does_something }1288#1289# # bad1290# after { do_something }1291# it { does_something }1292#1293# # bad1294# around { |test| test.run }1295# it { does_something }1296#1297# # good1298# before { do_something }1299#1300# it { does_something }1301#1302# # good1303# after { do_something }1304#1305# it { does_something }1306#1307# # good1308# around { |test| test.run }1309#1310# it { does_something }1311#1312# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_hook.rb:361313class RuboCop::Cop::RSpec::EmptyLineAfterHook < ::RuboCop::Cop::RSpec::Base1314 include ::RuboCop::Cop::RSpec::FinalEndLocation1315 include ::RuboCop::Cop::RangeHelp1316 include ::RuboCop::Cop::RSpec::EmptyLineSeparation1317 extend ::RuboCop::Cop::AutoCorrector1318 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_hook.rb:421319 def on_block(node); end1320end1321# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_hook.rb:401322RuboCop::Cop::RSpec::EmptyLineAfterHook::MSG = T.let(T.unsafe(nil), String)1323# Checks if there is an empty line after subject block.1324#1325# @example1326# # bad1327# subject(:obj) { described_class }1328# let(:foo) { bar }1329#1330# # good1331# subject(:obj) { described_class }1332#1333# let(:foo) { bar }1334#1335# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_subject.rb:171336class RuboCop::Cop::RSpec::EmptyLineAfterSubject < ::RuboCop::Cop::RSpec::Base1337 include ::RuboCop::Cop::RSpec::FinalEndLocation1338 include ::RuboCop::Cop::RangeHelp1339 include ::RuboCop::Cop::RSpec::EmptyLineSeparation1340 include ::RuboCop::Cop::RSpec::InsideExampleGroup1341 extend ::RuboCop::Cop::AutoCorrector1342 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_subject.rb:241343 def on_block(node); end1344end1345# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/empty_line_after_subject.rb:221346RuboCop::Cop::RSpec::EmptyLineAfterSubject::MSG = T.let(T.unsafe(nil), String)1347# Helps determine the offending location if there is not an empty line1348# following the node. Allows comments to follow directly after1349# in the following cases.1350# - followed by empty line(s)1351#1352# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/empty_line_separation.rb:111353module RuboCop::Cop::RSpec::EmptyLineSeparation1354 include ::RuboCop::Cop::RSpec::FinalEndLocation1355 include ::RuboCop::Cop::RangeHelp1356 # @return [Boolean]1357 #1358 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/empty_line_separation.rb:521359 def last_child?(node); end1360 # @yield [offending_loc(enable_directive_line || final_end_line)]1361 #1362 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/empty_line_separation.rb:261363 def missing_separating_line(node); end1364 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/empty_line_separation.rb:151365 def missing_separating_line_offense(node); end1366 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/empty_line_separation.rb:421367 def offending_loc(last_line); end1368end1369# Checks for long examples.1370#1371# A long example is usually more difficult to understand. Consider1372# extracting out some behavior, e.g. with a `let` block, or a helper1373# method.1374#1375# You can set literals you want to fold with `CountAsOne`.1376# Available are: 'array', 'hash', and 'heredoc'. Each literal1377# will be counted as one line regardless of its actual size.1378#1379# @example1380# # bad1381# it do1382# service = described_class.new1383# more_setup1384# more_setup1385# result = service.call1386# expect(result).to be(true)1387# end1388#1389# # good1390# it do1391# service = described_class.new1392# result = service.call1393# expect(result).to be(true)1394# end1395# @example CountAsOne: ['array', 'heredoc']1396#1397# it do1398# array = [ # +11399# 1,1400# 21401# ]1402#1403# hash = { # +31404# key: 'value'1405# }1406#1407# msg = <<~HEREDOC # +11408# Heredoc1409# content.1410# HEREDOC1411# end # 5 points1412#1413# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_length.rb:501414class RuboCop::Cop::RSpec::ExampleLength < ::RuboCop::Cop::RSpec::Base1415 include ::RuboCop::Cop::CodeLength1416 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_length.rb:551417 def on_block(node); end1418 private1419 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_length.rb:631420 def cop_label; end1421end1422# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_length.rb:531423RuboCop::Cop::RSpec::ExampleLength::LABEL = T.let(T.unsafe(nil), String)1424# Checks for examples without a description.1425#1426# RSpec allows for auto-generated example descriptions when there is no1427# description provided or the description is an empty one.1428#1429# This cop removes empty descriptions.1430# It also defines whether auto-generated description is allowed, based1431# on the configured style.1432#1433# This cop can be configured using the `EnforcedStyle` option1434#1435# @example `EnforcedStyle: always_allow` (default)1436# # bad1437# it('') { is_expected.to be_good }1438# it '' do1439# result = service.call1440# expect(result).to be(true)1441# end1442#1443# # good1444# it { is_expected.to be_good }1445# it do1446# result = service.call1447# expect(result).to be(true)1448# end1449# @example `EnforcedStyle: single_line_only`1450# # bad1451# it('') { is_expected.to be_good }1452# it do1453# result = service.call1454# expect(result).to be(true)1455# end1456#1457# # good1458# it { is_expected.to be_good }1459# @example `EnforcedStyle: disallow`1460# # bad1461# it { is_expected.to be_good }1462# it do1463# result = service.call1464# expect(result).to be(true)1465# end1466#1467# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_without_description.rb:501468class RuboCop::Cop::RSpec::ExampleWithoutDescription < ::RuboCop::Cop::RSpec::Base1469 include ::RuboCop::Cop::ConfigurableEnforcedStyle1470 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_without_description.rb:581471 def example_description(param0 = T.unsafe(nil)); end1472 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_without_description.rb:601473 def on_block(node); end1474 private1475 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_without_description.rb:741476 def check_example_without_description(node); end1477 # @return [Boolean]1478 #1479 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_without_description.rb:811480 def disallow_empty_description?(node); end1481end1482# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_without_description.rb:551483RuboCop::Cop::RSpec::ExampleWithoutDescription::MSG_ADD_DESCRIPTION = T.let(T.unsafe(nil), String)1484# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_without_description.rb:531485RuboCop::Cop::RSpec::ExampleWithoutDescription::MSG_DEFAULT_ARGUMENT = T.let(T.unsafe(nil), String)1486# Checks for common mistakes in example descriptions.1487#1488# This cop will correct docstrings that begin with 'should' and 'it'.1489#1490# The autocorrect is experimental - use with care! It can be configured1491# with CustomTransform (e.g. have => has) and IgnoredWords (e.g. only).1492#1493# @example1494# # bad1495# it 'should find nothing' do1496# end1497#1498# # good1499# it 'finds nothing' do1500# end1501# @example1502# # bad1503# it 'it does things' do1504# end1505#1506# # good1507# it 'does things' do1508# end1509# @see http://betterspecs.org/#should1510#1511# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_wording.rb:321512class RuboCop::Cop::RSpec::ExampleWording < ::RuboCop::Cop::RSpec::Base1513 extend ::RuboCop::Cop::AutoCorrector1514 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_wording.rb:421515 def it_description(param0 = T.unsafe(nil)); end1516 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_wording.rb:491517 def on_block(node); end1518 private1519 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_wording.rb:611520 def add_wording_offense(node, message); end1521 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_wording.rb:1081522 def custom_transform; end1523 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_wording.rb:711524 def docstring(node); end1525 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_wording.rb:1121526 def ignored_words; end1527 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_wording.rb:811528 def replacement_text(node); end1529 # Recursive processing is required to process nested dstr nodes1530 # that is the case for \-separated multiline strings with interpolation.1531 #1532 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_wording.rb:971533 def text(node); end1534end1535# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_wording.rb:391536RuboCop::Cop::RSpec::ExampleWording::IT_PREFIX = T.let(T.unsafe(nil), Regexp)1537# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_wording.rb:361538RuboCop::Cop::RSpec::ExampleWording::MSG_IT = T.let(T.unsafe(nil), String)1539# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_wording.rb:351540RuboCop::Cop::RSpec::ExampleWording::MSG_SHOULD = T.let(T.unsafe(nil), String)1541# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/example_wording.rb:381542RuboCop::Cop::RSpec::ExampleWording::SHOULD_PREFIX = T.let(T.unsafe(nil), Regexp)1543# Checks for excessive whitespace in example descriptions.1544#1545# @example1546# # bad1547# it ' has excessive spacing ' do1548# end1549#1550# # good1551# it 'has excessive spacing' do1552# end1553# @example1554# # bad1555# context ' when a condition is met ' do1556# end1557#1558# # good1559# context 'when a condition is met' do1560# end1561#1562# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:251563class RuboCop::Cop::RSpec::ExcessiveDocstringSpacing < ::RuboCop::Cop::RSpec::Base1564 extend ::RuboCop::Cop::AutoCorrector1565 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:311566 def example_description(param0 = T.unsafe(nil)); end1567 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:381568 def on_send(node); end1569 private1570 # @param node [RuboCop::AST::Node]1571 # @param text [String]1572 #1573 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:661574 def add_whitespace_offense(node, text); end1575 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:751576 def docstring(node); end1577 # @param text [String]1578 # @return [Boolean]1579 #1580 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:531581 def excessive_whitespace?(text); end1582 # @param text [String]1583 #1584 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:601585 def strip_excessive_whitespace(text); end1586 # Recursive processing is required to process nested dstr nodes1587 # that is the case for \-separated multiline strings with interpolation.1588 #1589 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:871590 def text(node); end1591end1592# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/excessive_docstring_spacing.rb:281593RuboCop::Cop::RSpec::ExcessiveDocstringSpacing::MSG = T.let(T.unsafe(nil), String)1594# Checks for `expect(...)` calls containing literal values.1595#1596# Autocorrection is performed when the expected is not a literal.1597#1598# @example1599# # bad1600# expect(5).to eq(price)1601# expect(/foo/).to eq(pattern)1602# expect("John").to eq(name)1603#1604# # good1605# expect(price).to eq(5)1606# expect(pattern).to eq(/foo/)1607# expect(name).to eq("John")1608#1609# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_actual.rb:211610class RuboCop::Cop::RSpec::ExpectActual < ::RuboCop::Cop::RSpec::Base1611 extend ::RuboCop::Cop::AutoCorrector1612 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_actual.rb:511613 def expect_literal(param0 = T.unsafe(nil)); end1614 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_actual.rb:621615 def on_send(node); end1616 private1617 # @return [Boolean]1618 #1619 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_actual.rb:851620 def complex_literal?(node); end1621 # This is not implement using a NodePattern because it seems1622 # to not be able to match against an explicit (nil) sexp1623 #1624 # @return [Boolean]1625 #1626 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_actual.rb:771627 def literal?(node); end1628 # @return [Boolean]1629 #1630 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_actual.rb:811631 def simple_literal?(node); end1632 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_actual.rb:901633 def swap(corrector, actual, expected); end1634end1635# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_actual.rb:391636RuboCop::Cop::RSpec::ExpectActual::COMPLEX_LITERALS = T.let(T.unsafe(nil), Array)1637# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_actual.rb:241638RuboCop::Cop::RSpec::ExpectActual::MSG = T.let(T.unsafe(nil), String)1639# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_actual.rb:261640RuboCop::Cop::RSpec::ExpectActual::SIMPLE_LITERALS = T.let(T.unsafe(nil), Array)1641# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_actual.rb:481642RuboCop::Cop::RSpec::ExpectActual::SUPPORTED_MATCHERS = T.let(T.unsafe(nil), Array)1643# Checks for consistent style of change matcher.1644#1645# Enforces either passing object and attribute as arguments to the matcher1646# or passing a block that reads the attribute value.1647#1648# This cop can be configured using the `EnforcedStyle` option.1649#1650# @example `EnforcedStyle: method_call` (default)1651# # bad1652# expect { run }.to change { Foo.bar }1653# expect { run }.to change { foo.baz }1654#1655# # good1656# expect { run }.to change(Foo, :bar)1657# expect { run }.to change(foo, :baz)1658# # also good when there are arguments or chained method calls1659# expect { run }.to change { Foo.bar(:count) }1660# expect { run }.to change { user.reload.name }1661# @example `EnforcedStyle: block`1662# # bad1663# expect { run }.to change(Foo, :bar)1664#1665# # good1666# expect { run }.to change { Foo.bar }1667#1668# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_change.rb:321669class RuboCop::Cop::RSpec::ExpectChange < ::RuboCop::Cop::RSpec::Base1670 include ::RuboCop::Cop::ConfigurableEnforcedStyle1671 extend ::RuboCop::Cop::AutoCorrector1672 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_change.rb:411673 def expect_change_with_arguments(param0 = T.unsafe(nil)); end1674 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_change.rb:461675 def expect_change_with_block(param0 = T.unsafe(nil)); end1676 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_change.rb:721677 def on_block(node); end1678 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_change.rb:601679 def on_send(node); end1680end1681# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_change.rb:361682RuboCop::Cop::RSpec::ExpectChange::MSG_BLOCK = T.let(T.unsafe(nil), String)1683# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_change.rb:371684RuboCop::Cop::RSpec::ExpectChange::MSG_CALL = T.let(T.unsafe(nil), String)1685# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_change.rb:381686RuboCop::Cop::RSpec::ExpectChange::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)1687# Do not use `expect` in hooks such as `before`.1688#1689# @example1690# # bad1691# before do1692# expect(something).to eq 'foo'1693# end1694#1695# # bad1696# after do1697# expect_any_instance_of(Something).to receive(:foo)1698# end1699#1700# # good1701# it do1702# expect(something).to eq 'foo'1703# end1704#1705# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_in_hook.rb:231706class RuboCop::Cop::RSpec::ExpectInHook < ::RuboCop::Cop::RSpec::Base1707 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_in_hook.rb:271708 def expectation(param0); end1709 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_in_hook.rb:291710 def on_block(node); end1711 private1712 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_in_hook.rb:411713 def message(expect, hook); end1714end1715# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_in_hook.rb:241716RuboCop::Cop::RSpec::ExpectInHook::MSG = T.let(T.unsafe(nil), String)1717# Checks for opportunities to use `expect { ... }.to output`.1718#1719# @example1720# # bad1721# $stdout = StringIO.new1722# my_app.print_report1723# $stdout = STDOUT1724# expect($stdout.string).to eq('Hello World')1725#1726# # good1727# expect { my_app.print_report }.to output('Hello World').to_stdout1728#1729# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_output.rb:171730class RuboCop::Cop::RSpec::ExpectOutput < ::RuboCop::Cop::RSpec::Base1731 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_output.rb:211732 def on_gvasgn(node); end1733 private1734 # Detect if we are inside the scope of a single example1735 #1736 # We want to encourage using `expect { ... }.to output` so1737 # we only care about situations where you would replace with1738 # an expectation. Therefore, assignments to stderr or stdout1739 # within a `before(:all)` or otherwise outside of an example1740 # don't matter.1741 #1742 # @return [Boolean]1743 #1744 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_output.rb:421745 def inside_example_scope?(node); end1746end1747# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/expect_output.rb:181748RuboCop::Cop::RSpec::ExpectOutput::MSG = T.let(T.unsafe(nil), String)1749# A helper for `explicit` style1750#1751# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:1211752module RuboCop::Cop::RSpec::ExplicitHelper1753 include ::RuboCop::RSpec::Language1754 extend ::RuboCop::AST::NodePattern::Macros1755 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:1591756 def predicate_matcher?(param0 = T.unsafe(nil)); end1757 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:1681758 def predicate_matcher_block?(param0 = T.unsafe(nil)); end1759 private1760 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:1351761 def allowed_explicit_matchers; end1762 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:1391763 def check_explicit(node); end1764 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:1911765 def corrector_explicit(corrector, to_node, actual, matcher, block_child); end1766 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:1851767 def message_explicit(matcher); end1768 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:1981769 def move_predicate(corrector, actual, matcher, block_child); end1770 # @return [Boolean]1771 #1772 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:1771773 def predicate_matcher_name?(name); end1774 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:2281775 def replacement_matcher(node); end1776 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:2101777 def to_predicate_method(matcher); end1778end1779# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:1271780RuboCop::Cop::RSpec::ExplicitHelper::BUILT_IN_MATCHERS = T.let(T.unsafe(nil), Array)1781# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:1251782RuboCop::Cop::RSpec::ExplicitHelper::MSG_EXPLICIT = T.let(T.unsafe(nil), String)1783# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:61784module RuboCop::Cop::RSpec::FactoryBot; end1785# Always declare attribute values as blocks.1786#1787# @example1788# # bad1789# kind [:active, :rejected].sample1790#1791# # good1792# kind { [:active, :rejected].sample }1793#1794# # bad1795# closed_at 1.day.from_now1796#1797# # good1798# closed_at { 1.day.from_now }1799#1800# # bad1801# count 11802#1803# # good1804# count { 1 }1805#1806# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:271807class RuboCop::Cop::RSpec::FactoryBot::AttributeDefinedStatically < ::RuboCop::Cop::RSpec::Base1808 extend ::RuboCop::Cop::AutoCorrector1809 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:851810 def association?(param0 = T.unsafe(nil)); end1811 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:381812 def factory_attributes(param0 = T.unsafe(nil)); end1813 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:421814 def on_block(node); end1815 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:331816 def value_matcher(param0 = T.unsafe(nil)); end1817 private1818 # @return [Boolean]1819 #1820 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:1191821 def attribute_defining_method?(method_name); end1822 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:581823 def autocorrect(corrector, node); end1824 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:871825 def autocorrect_replacing_parens(corrector, node); end1826 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:941827 def autocorrect_without_parens(corrector, node); end1828 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:1031829 def braces(node); end1830 # @return [Boolean]1831 #1832 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:661833 def offensive_receiver?(receiver, node); end1834 # @return [Boolean]1835 #1836 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:801837 def proc?(attribute); end1838 # @return [Boolean]1839 #1840 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:721841 def receiver_matches_first_block_argument?(receiver, node); end1842 # @return [Boolean]1843 #1844 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:1151845 def reserved_method?(method_name); end1846 # @return [Boolean]1847 #1848 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:1111849 def value_hash_without_braces?(node); end1850end1851# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/attribute_defined_statically.rb:301852RuboCop::Cop::RSpec::FactoryBot::AttributeDefinedStatically::MSG = T.let(T.unsafe(nil), String)1853# Checks for create_list usage.1854#1855# This cop can be configured using the `EnforcedStyle` option1856#1857# @example `EnforcedStyle: create_list` (default)1858# # bad1859# 3.times { create :user }1860#1861# # good1862# create_list :user, 31863#1864# # bad1865# 3.times { create :user, age: 18 }1866#1867# # good - index is used to alter the created models attributes1868# 3.times { |n| create :user, age: n }1869#1870# # good - contains a method call, may return different values1871# 3.times { create :user, age: rand }1872# @example `EnforcedStyle: n_times`1873# # bad1874# create_list :user, 31875#1876# # good1877# 3.times { create :user }1878#1879# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:331880class RuboCop::Cop::RSpec::FactoryBot::CreateList < ::RuboCop::Cop::RSpec::Base1881 include ::RuboCop::Cop::ConfigurableEnforcedStyle1882 include ::RuboCop::RSpec::FactoryBot::Language1883 extend ::RuboCop::Cop::AutoCorrector1884 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:601885 def arguments_include_method_call?(param0 = T.unsafe(nil)); end1886 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:651887 def factory_call(param0 = T.unsafe(nil)); end1888 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:701889 def factory_list_call(param0 = T.unsafe(nil)); end1890 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:431891 def n_times_block?(param0 = T.unsafe(nil)); end1892 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:511893 def n_times_block_with_arg_and_used?(param0 = T.unsafe(nil)); end1894 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:741895 def on_block(node); end1896 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:881897 def on_send(node); end1898 private1899 # @return [Boolean]1900 #1901 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:1011902 def contains_only_factory?(node); end1903end1904# :nodoc1905#1906# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:1101907module RuboCop::Cop::RSpec::FactoryBot::CreateList::Corrector1908 private1909 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:1131910 def build_options_string(options); end1911 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:1171912 def format_method_call(node, method, arguments); end1913 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:1251914 def format_receiver(receiver); end1915end1916# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:1631917class RuboCop::Cop::RSpec::FactoryBot::CreateList::CreateListCorrector1918 include ::RuboCop::Cop::RSpec::FactoryBot::CreateList::Corrector1919 # @return [CreateListCorrector] a new instance of CreateListCorrector1920 #1921 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:1661922 def initialize(node); end1923 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:1701924 def call(corrector); end1925 private1926 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:1931927 def build_arguments(node, count); end1928 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:2021929 def call_replacement(node); end1930 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:1841931 def call_with_block_replacement(node); end1932 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:2151933 def format_block(node); end1934 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:2231935 def format_multiline_block(node); end1936 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:2311937 def format_singleline_block(node); end1938 # Returns the value of attribute node.1939 #1940 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:1821941 def node; end1942end1943# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:381944RuboCop::Cop::RSpec::FactoryBot::CreateList::MSG_CREATE_LIST = T.let(T.unsafe(nil), String)1945# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:391946RuboCop::Cop::RSpec::FactoryBot::CreateList::MSG_N_TIMES = T.let(T.unsafe(nil), String)1947# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:401948RuboCop::Cop::RSpec::FactoryBot::CreateList::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)1949# :nodoc1950#1951# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:1331952class RuboCop::Cop::RSpec::FactoryBot::CreateList::TimesCorrector1953 include ::RuboCop::Cop::RSpec::FactoryBot::CreateList::Corrector1954 # @return [TimesCorrector] a new instance of TimesCorrector1955 #1956 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:1361957 def initialize(node); end1958 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:1401959 def call(corrector); end1960 private1961 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:1491962 def generate_n_times_block(node); end1963 # Returns the value of attribute node.1964 #1965 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/create_list.rb:1471966 def node; end1967end1968# Use string value when setting the class attribute explicitly.1969#1970# This cop would promote faster tests by lazy-loading of1971# application files. Also, this could help you suppress potential bugs1972# in combination with external libraries by avoiding a preload of1973# application files from the factory files.1974#1975# @example1976# # bad1977# factory :foo, class: Foo do1978# end1979#1980# # good1981# factory :foo, class: 'Foo' do1982# end1983#1984# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb:221985class RuboCop::Cop::RSpec::FactoryBot::FactoryClassName < ::RuboCop::Cop::RSpec::Base1986 extend ::RuboCop::Cop::AutoCorrector1987 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb:311988 def class_name(param0 = T.unsafe(nil)); end1989 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb:351990 def on_send(node); end1991 private1992 # @return [Boolean]1993 #1994 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb:481995 def allowed?(const_name); end1996end1997# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb:271998RuboCop::Cop::RSpec::FactoryBot::FactoryClassName::ALLOWED_CONSTANTS = T.let(T.unsafe(nil), Array)1999# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb:252000RuboCop::Cop::RSpec::FactoryBot::FactoryClassName::MSG = T.let(T.unsafe(nil), String)2001# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/factory_class_name.rb:282002RuboCop::Cop::RSpec::FactoryBot::FactoryClassName::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)2003# Use shorthands from `FactoryBot::Syntax::Methods` in your specs.2004#2005# @example2006# # bad2007# FactoryBot.create(:bar)2008# FactoryBot.build(:bar)2009# FactoryBot.attributes_for(:bar)2010#2011# # good2012# create(:bar)2013# build(:bar)2014# attributes_for(:bar)2015#2016# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb:492017class RuboCop::Cop::RSpec::FactoryBot::SyntaxMethods < ::RuboCop::Cop::RSpec::Base2018 include ::RuboCop::Cop::RSpec::InsideExampleGroup2019 include ::RuboCop::Cop::RangeHelp2020 include ::RuboCop::RSpec::FactoryBot::Language2021 extend ::RuboCop::Cop::AutoCorrector2022 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb:772023 def on_send(node); end2024 private2025 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb:902026 def crime_scene(node); end2027 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb:972028 def offense(node); end2029end2030# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb:552031RuboCop::Cop::RSpec::FactoryBot::SyntaxMethods::MSG = T.let(T.unsafe(nil), String)2032# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/factory_bot/syntax_methods.rb:572033RuboCop::Cop::RSpec::FactoryBot::SyntaxMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set)2034# Checks that spec file paths are consistent and well-formed.2035#2036# By default, this checks that spec file paths are consistent with the2037# test subject and and enforces that it reflects the described2038# class/module and its optionally called out method.2039#2040# With the configuration option `IgnoreMethods` the called out method will2041# be ignored when determining the enforced path.2042#2043# With the configuration option `CustomTransform` modules or classes can2044# be specified that should not as usual be transformed from CamelCase to2045# snake_case (e.g. 'RuboCop' => 'rubocop' ).2046#2047# With the configuration option `SpecSuffixOnly` test files will only2048# be checked to ensure they end in '_spec.rb'. This option disables2049# checking for consistency in the test subject or test methods.2050#2051# @example2052# # bad2053# whatever_spec.rb # describe MyClass2054#2055# # bad2056# my_class_spec.rb # describe MyClass, '#method'2057#2058# # good2059# my_class_spec.rb # describe MyClass2060#2061# # good2062# my_class_method_spec.rb # describe MyClass, '#method'2063#2064# # good2065# my_class/method_spec.rb # describe MyClass, '#method'2066# @example when configuration is `IgnoreMethods: true`2067# # bad2068# whatever_spec.rb # describe MyClass2069#2070# # good2071# my_class_spec.rb # describe MyClass2072#2073# # good2074# my_class_spec.rb # describe MyClass, '#method'2075# @example when configuration is `SpecSuffixOnly: true`2076# # good2077# whatever_spec.rb # describe MyClass2078#2079# # good2080# my_class_spec.rb # describe MyClass2081#2082# # good2083# my_class_spec.rb # describe MyClass, '#method'2084#2085# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:592086class RuboCop::Cop::RSpec::FilePath < ::RuboCop::Cop::RSpec::Base2087 include ::RuboCop::Cop::RSpec::TopLevelGroup2088 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:652089 def example_group(param0 = T.unsafe(nil)); end2090 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:742091 def on_top_level_example_group(node); end2092 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:722093 def routing_metadata?(param0); end2094 private2095 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:1332096 def camel_to_snake_case(string); end2097 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:1402098 def custom_transform; end2099 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:862100 def ensure_correct_file_path(send_node, example_group, arguments); end2101 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:1252102 def expected_path(constant); end2103 # @return [Boolean]2104 #2105 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:1482106 def filename_ends_with?(pattern); end2107 # @return [Boolean]2108 #2109 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:1442110 def ignore_methods?; end2111 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:1182112 def name_pattern(method_name); end2113 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:1022114 def pattern_for(example_group, method_name); end2115 # @return [Boolean]2116 #2117 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:1142118 def pattern_for_spec_suffix_only?; end2119 # @return [Boolean]2120 #2121 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:1532122 def relevant_rubocop_rspec_file?(_file); end2123 # @return [Boolean]2124 #2125 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:982126 def routing_spec?(args); end2127 # @return [Boolean]2128 #2129 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:1572130 def spec_suffix_only?; end2131end2132# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/file_path.rb:622133RuboCop::Cop::RSpec::FilePath::MSG = T.let(T.unsafe(nil), String)2134# Helps find the true end location of nodes which might contain heredocs.2135#2136# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/final_end_location.rb:72137module RuboCop::Cop::RSpec::FinalEndLocation2138 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/final_end_location.rb:82139 def final_end_location(start_node); end2140end2141# Checks if examples are focused.2142#2143# @example2144# # bad2145# describe MyClass, focus: true do2146# end2147#2148# describe MyClass, :focus do2149# end2150#2151# fdescribe MyClass do2152# end2153#2154# # good2155# describe MyClass do2156# end2157#2158# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/focus.rb:222159class RuboCop::Cop::RSpec::Focus < ::RuboCop::Cop::RSpec::Base2160 include ::RuboCop::Cop::RangeHelp2161 extend ::RuboCop::Cop::AutoCorrector2162 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/focus.rb:292163 def focusable_selector?(param0 = T.unsafe(nil)); end2164 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/focus.rb:462165 def focused_block?(param0 = T.unsafe(nil)); end2166 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/focus.rb:402167 def metadata(param0 = T.unsafe(nil)); end2168 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/focus.rb:512169 def on_send(node); end2170 private2171 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/focus.rb:782172 def correct_send(corrector, focus); end2173 # @yield [node]2174 #2175 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/focus.rb:652176 def focus_metadata(node, &block); end2177 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/focus.rb:712178 def with_surrounding(focus); end2179end2180# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/focus.rb:262181RuboCop::Cop::RSpec::Focus::MSG = T.let(T.unsafe(nil), String)2182# Checks the arguments passed to `before`, `around`, and `after`.2183#2184# This cop checks for consistent style when specifying RSpec2185# hooks which run for each example. There are three supported2186# styles: "implicit", "each", and "example." All styles have2187# the same behavior.2188#2189# @example `EnforcedStyle: implicit` (default)2190# # bad2191# before(:each) do2192# # ...2193# end2194#2195# # bad2196# before(:example) do2197# # ...2198# end2199#2200# # good2201# before do2202# # ...2203# end2204# @example `EnforcedStyle: each`2205# # bad2206# before(:example) do2207# # ...2208# end2209#2210# # bad2211# before do2212# # ...2213# end2214#2215# # good2216# before(:each) do2217# # ...2218# end2219# @example `EnforcedStyle: example`2220# # bad2221# before(:each) do2222# # ...2223# end2224#2225# # bad2226# before do2227# # ...2228# end2229#2230# # good2231# before(:example) do2232# # ...2233# end2234#2235# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hook_argument.rb:602236class RuboCop::Cop::RSpec::HookArgument < ::RuboCop::Cop::RSpec::Base2237 include ::RuboCop::Cop::ConfigurableEnforcedStyle2238 extend ::RuboCop::Cop::AutoCorrector2239 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hook_argument.rb:752240 def on_block(node); end2241 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hook_argument.rb:682242 def scoped_hook(param0 = T.unsafe(nil)); end2243 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hook_argument.rb:732244 def unscoped_hook(param0 = T.unsafe(nil)); end2245 private2246 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hook_argument.rb:1182247 def argument_range(send_node); end2248 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hook_argument.rb:912249 def check_implicit(method_send); end2250 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hook_argument.rb:1022251 def explicit_message(scope); end2252 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hook_argument.rb:1142253 def hook(node, &block); end2254 # @return [Boolean]2255 #2256 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hook_argument.rb:1102257 def implicit_style?; end2258end2259# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hook_argument.rb:652260RuboCop::Cop::RSpec::HookArgument::EXPLICIT_MSG = T.let(T.unsafe(nil), String)2261# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hook_argument.rb:642262RuboCop::Cop::RSpec::HookArgument::IMPLICIT_MSG = T.let(T.unsafe(nil), String)2263# Checks for before/around/after hooks that come after an example.2264#2265# @example2266# # Bad2267#2268# it 'checks what foo does' do2269# expect(foo).to be2270# end2271#2272# before { prepare }2273# after { clean_up }2274#2275# # Good2276# before { prepare }2277# after { clean_up }2278#2279# it 'checks what foo does' do2280# expect(foo).to be2281# end2282#2283# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hooks_before_examples.rb:262284class RuboCop::Cop::RSpec::HooksBeforeExamples < ::RuboCop::Cop::RSpec::Base2285 extend ::RuboCop::Cop::AutoCorrector2286 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hooks_before_examples.rb:322287 def example_or_group?(param0 = T.unsafe(nil)); end2288 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hooks_before_examples.rb:392289 def on_block(node); end2290 private2291 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hooks_before_examples.rb:702292 def autocorrect(corrector, node, first_example); end2293 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hooks_before_examples.rb:512294 def check_hooks(node); end2295 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hooks_before_examples.rb:662296 def find_first_example(node); end2297 # @return [Boolean]2298 #2299 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hooks_before_examples.rb:472300 def multiline_block?(block); end2301end2302# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/hooks_before_examples.rb:292303RuboCop::Cop::RSpec::HooksBeforeExamples::MSG = T.let(T.unsafe(nil), String)2304# Checks for equality assertions with identical expressions on both sides.2305#2306# @example2307#2308# # bad2309# expect(foo.bar).to eq(foo.bar)2310# expect(foo.bar).to eql(foo.bar)2311#2312# # good2313# expect(foo.bar).to eq(2)2314# expect(foo.bar).to eql(2)2315#2316# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/identical_equality_assertion.rb:182317class RuboCop::Cop::RSpec::IdenticalEqualityAssertion < ::RuboCop::Cop::RSpec::Base2318 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/identical_equality_assertion.rb:242319 def equality_check?(param0 = T.unsafe(nil)); end2320 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/identical_equality_assertion.rb:302321 def on_send(node); end2322end2323# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/identical_equality_assertion.rb:192324RuboCop::Cop::RSpec::IdenticalEqualityAssertion::MSG = T.let(T.unsafe(nil), String)2325# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/identical_equality_assertion.rb:212326RuboCop::Cop::RSpec::IdenticalEqualityAssertion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)2327# Check that implicit block expectation syntax is not used.2328#2329# Prefer using explicit block expectations.2330#2331# @example2332# # bad2333# subject { -> { do_something } }2334# it { is_expected.to change(something).to(new_value) }2335#2336# # good2337# it 'changes something to a new value' do2338# expect { do_something }.to change(something).to(new_value)2339# end2340#2341# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_block_expectation.rb:192342class RuboCop::Cop::RSpec::ImplicitBlockExpectation < ::RuboCop::Cop::RSpec::Base2343 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_block_expectation.rb:352344 def implicit_expect(param0 = T.unsafe(nil)); end2345 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_block_expectation.rb:242346 def lambda?(param0 = T.unsafe(nil)); end2347 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_block_expectation.rb:322348 def lambda_subject?(param0 = T.unsafe(nil)); end2349 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_block_expectation.rb:392350 def on_send(node); end2351 private2352 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_block_expectation.rb:612353 def find_subject(block_node); end2354 # @return [Boolean]2355 #2356 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_block_expectation.rb:572357 def multi_statement_example_group?(node); end2358 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_block_expectation.rb:482359 def nearest_subject(node); end2360end2361# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_block_expectation.rb:202362RuboCop::Cop::RSpec::ImplicitBlockExpectation::MSG = T.let(T.unsafe(nil), String)2363# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_block_expectation.rb:212364RuboCop::Cop::RSpec::ImplicitBlockExpectation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)2365# Check that a consistent implicit expectation style is used.2366#2367# This cop can be configured using the `EnforcedStyle` option2368# and supports the `--auto-gen-config` flag.2369#2370# @example `EnforcedStyle: is_expected` (default)2371#2372# # bad2373# it { should be_truthy }2374#2375# # good2376# it { is_expected.to be_truthy }2377# @example `EnforcedStyle: should`2378#2379# # bad2380# it { is_expected.to be_truthy }2381#2382# # good2383# it { should be_truthy }2384#2385# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_expect.rb:272386class RuboCop::Cop::RSpec::ImplicitExpect < ::RuboCop::Cop::RSpec::Base2387 include ::RuboCop::Cop::ConfigurableEnforcedStyle2388 extend ::RuboCop::Cop::AutoCorrector2389 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_expect.rb:342390 def implicit_expect(param0 = T.unsafe(nil)); end2391 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_expect.rb:492392 def on_send(node); end2393 private2394 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_expect.rb:782395 def is_expected_range(source_map); end2396 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_expect.rb:692397 def offending_expect(node); end2398 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_expect.rb:862399 def offense_message(offending_source); end2400 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_expect.rb:942401 def replacement_source(offending_source); end2402end2403# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_expect.rb:472404RuboCop::Cop::RSpec::ImplicitExpect::ENFORCED_REPLACEMENTS = T.let(T.unsafe(nil), Hash)2405# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_expect.rb:312406RuboCop::Cop::RSpec::ImplicitExpect::MSG = T.let(T.unsafe(nil), String)2407# Checks for usage of implicit subject (`is_expected` / `should`).2408#2409# This cop can be configured using the `EnforcedStyle` option2410#2411# @example `EnforcedStyle: single_line_only` (default)2412# # bad2413# it do2414# is_expected.to be_truthy2415# end2416#2417# # good2418# it { is_expected.to be_truthy }2419# it do2420# expect(subject).to be_truthy2421# end2422# @example `EnforcedStyle: single_statement_only`2423# # bad2424# it do2425# foo = 12426# is_expected.to be_truthy2427# end2428#2429# # good2430# it do2431# foo = 12432# expect(subject).to be_truthy2433# end2434# it do2435# is_expected.to be_truthy2436# end2437# @example `EnforcedStyle: disallow`2438# # bad2439# it { is_expected.to be_truthy }2440#2441# # good2442# it { expect(subject).to be_truthy }2443#2444# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_subject.rb:452445class RuboCop::Cop::RSpec::ImplicitSubject < ::RuboCop::Cop::RSpec::Base2446 include ::RuboCop::Cop::ConfigurableEnforcedStyle2447 extend ::RuboCop::Cop::AutoCorrector2448 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_subject.rb:532449 def implicit_subject?(param0 = T.unsafe(nil)); end2450 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_subject.rb:572451 def on_send(node); end2452 private2453 # @return [Boolean]2454 #2455 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_subject.rb:872456 def allowed_by_style?(example); end2457 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_subject.rb:682458 def autocorrect(corrector, node); end2459 # @return [Boolean]2460 #2461 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_subject.rb:802462 def valid_usage?(node); end2463end2464# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_subject.rb:492465RuboCop::Cop::RSpec::ImplicitSubject::MSG = T.let(T.unsafe(nil), String)2466# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/implicit_subject.rb:502467RuboCop::Cop::RSpec::ImplicitSubject::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)2468# A helper for `inflected` style2469#2470# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:72471module RuboCop::Cop::RSpec::InflectedHelper2472 include ::RuboCop::RSpec::Language2473 extend ::RuboCop::AST::NodePattern::Macros2474 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:392475 def be_bool?(param0 = T.unsafe(nil)); end2476 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:442477 def be_boolthy?(param0 = T.unsafe(nil)); end2478 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:292479 def predicate_in_actual?(param0 = T.unsafe(nil)); end2480 private2481 # @return [Boolean]2482 #2483 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:482484 def boolean_matcher?(node); end2485 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:162486 def check_inflected(node); end2487 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:602488 def message_inflected(predicate); end2489 # @return [Boolean]2490 #2491 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:562492 def predicate?(sym); end2493 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:852494 def remove_predicate(corrector, predicate); end2495 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:962496 def rewrite_matcher(corrector, predicate, matcher); end2497 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:672498 def to_predicate_matcher(name); end2499 # @return [Boolean]2500 #2501 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:1072502 def true?(to_symbol, matcher); end2503end2504# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:112505RuboCop::Cop::RSpec::InflectedHelper::MSG_INFLECTED = T.let(T.unsafe(nil), String)2506# Helps you identify whether a given node2507# is within an example group or not.2508#2509# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/inside_example_group.rb:82510module RuboCop::Cop::RSpec::InsideExampleGroup2511 private2512 # @return [Boolean]2513 #2514 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/inside_example_group.rb:192515 def example_group_root?(node); end2516 # @return [Boolean]2517 #2518 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/inside_example_group.rb:232519 def example_group_root_with_siblings?(node); end2520 # @return [Boolean]2521 #2522 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/inside_example_group.rb:112523 def inside_example_group?(node); end2524end2525# Checks for `instance_double` used with `have_received`.2526#2527# @example2528# # bad2529# it do2530# foo = instance_double(Foo).as_null_object2531# expect(foo).to have_received(:bar)2532# end2533#2534# # good2535# it do2536# foo = instance_spy(Foo)2537# expect(foo).to have_received(:bar)2538# end2539#2540# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_spy.rb:212541class RuboCop::Cop::RSpec::InstanceSpy < ::RuboCop::Cop::RSpec::Base2542 extend ::RuboCop::Cop::AutoCorrector2543 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_spy.rb:362544 def have_received_usage(param0); end2545 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_spy.rb:282546 def null_double(param0); end2547 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_spy.rb:452548 def on_block(node); end2549 private2550 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_spy.rb:612551 def autocorrect(corrector, node); end2552end2553# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_spy.rb:242554RuboCop::Cop::RSpec::InstanceSpy::MSG = T.let(T.unsafe(nil), String)2555# Checks for instance variable usage in specs.2556#2557# This cop can be configured with the option `AssignmentOnly` which2558# will configure the cop to only register offenses on instance2559# variable usage if the instance variable is also assigned within2560# the spec2561#2562# @example2563# # bad2564# describe MyClass do2565# before { @foo = [] }2566# it { expect(@foo).to be_empty }2567# end2568#2569# # good2570# describe MyClass do2571# let(:foo) { [] }2572# it { expect(foo).to be_empty }2573# end2574# @example with AssignmentOnly configuration2575#2576# # rubocop.yml2577# # RSpec/InstanceVariable:2578# # AssignmentOnly: false2579#2580# # bad2581# describe MyClass do2582# before { @foo = [] }2583# it { expect(@foo).to be_empty }2584# end2585#2586# # allowed2587# describe MyClass do2588# it { expect(@foo).to be_empty }2589# end2590#2591# # good2592# describe MyClass do2593# let(:foo) { [] }2594# it { expect(foo).to be_empty }2595# end2596#2597# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_variable.rb:492598class RuboCop::Cop::RSpec::InstanceVariable < ::RuboCop::Cop::RSpec::Base2599 include ::RuboCop::Cop::RSpec::TopLevelGroup2600 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_variable.rb:612601 def custom_matcher?(param0 = T.unsafe(nil)); end2602 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_variable.rb:562603 def dynamic_class?(param0 = T.unsafe(nil)); end2604 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_variable.rb:722605 def ivar_assigned?(param0, param1); end2606 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_variable.rb:692607 def ivar_usage(param0); end2608 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_variable.rb:742609 def on_top_level_group(node); end2610 private2611 # @return [Boolean]2612 #2613 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_variable.rb:912614 def assignment_only?; end2615 # @return [Boolean]2616 #2617 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_variable.rb:852618 def valid_usage?(node); end2619end2620# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/instance_variable.rb:522621RuboCop::Cop::RSpec::InstanceVariable::MSG = T.let(T.unsafe(nil), String)2622# Checks that only one `it_behaves_like` style is used.2623#2624# @example `EnforcedStyle: it_behaves_like` (default)2625# # bad2626# it_should_behave_like 'a foo'2627#2628# # good2629# it_behaves_like 'a foo'2630# @example `EnforcedStyle: it_should_behave_like`2631# # bad2632# it_behaves_like 'a foo'2633#2634# # good2635# it_should_behave_like 'a foo'2636#2637# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/it_behaves_like.rb:212638class RuboCop::Cop::RSpec::ItBehavesLike < ::RuboCop::Cop::RSpec::Base2639 include ::RuboCop::Cop::ConfigurableEnforcedStyle2640 extend ::RuboCop::Cop::AutoCorrector2641 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/it_behaves_like.rb:302642 def example_inclusion_offense(param0 = T.unsafe(nil), param1); end2643 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/it_behaves_like.rb:322644 def on_send(node); end2645 private2646 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/it_behaves_like.rb:422647 def message(_node); end2648end2649# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/it_behaves_like.rb:252650RuboCop::Cop::RSpec::ItBehavesLike::MSG = T.let(T.unsafe(nil), String)2651# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/it_behaves_like.rb:272652RuboCop::Cop::RSpec::ItBehavesLike::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)2653# Check that `all` matcher is used instead of iterating over an array.2654#2655# @example2656# # bad2657# it 'validates users' do2658# [user1, user2, user3].each { |user| expect(user).to be_valid }2659# end2660#2661# # good2662# it 'validates users' do2663# expect([user1, user2, user3]).to all(be_valid)2664# end2665#2666# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/iterated_expectation.rb:182667class RuboCop::Cop::RSpec::IteratedExpectation < ::RuboCop::Cop::RSpec::Base2668 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/iterated_expectation.rb:232669 def each?(param0 = T.unsafe(nil)); end2670 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/iterated_expectation.rb:322671 def expectation?(param0 = T.unsafe(nil), param1); end2672 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/iterated_expectation.rb:362673 def on_block(node); end2674 private2675 # @return [Boolean]2676 #2677 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/iterated_expectation.rb:502678 def only_expectations?(body, arg); end2679 # @return [Boolean]2680 #2681 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/iterated_expectation.rb:462682 def single_expectation?(body, arg); end2683end2684# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/iterated_expectation.rb:192685RuboCop::Cop::RSpec::IteratedExpectation::MSG = T.let(T.unsafe(nil), String)2686# Enforce that subject is the first definition in the test.2687#2688# @example2689# # bad2690# let(:params) { blah }2691# subject { described_class.new(params) }2692#2693# before { do_something }2694# subject { described_class.new(params) }2695#2696# it { expect_something }2697# subject { described_class.new(params) }2698# it { expect_something_else }2699#2700# # good2701# subject { described_class.new(params) }2702# let(:params) { blah }2703#2704# # good2705# subject { described_class.new(params) }2706# before { do_something }2707#2708# # good2709# subject { described_class.new(params) }2710# it { expect_something }2711# it { expect_something_else }2712#2713# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leading_subject.rb:342714class RuboCop::Cop::RSpec::LeadingSubject < ::RuboCop::Cop::RSpec::Base2715 include ::RuboCop::Cop::RSpec::InsideExampleGroup2716 extend ::RuboCop::Cop::AutoCorrector2717 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leading_subject.rb:472718 def check_previous_nodes(node); end2719 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leading_subject.rb:402720 def on_block(node); end2721 private2722 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leading_subject.rb:702723 def autocorrect(corrector, node, sibling); end2724 # @return [Boolean]2725 #2726 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leading_subject.rb:762727 def offending?(node); end2728 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leading_subject.rb:582729 def offending_node(node); end2730 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leading_subject.rb:662731 def parent(node); end2732end2733# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leading_subject.rb:382734RuboCop::Cop::RSpec::LeadingSubject::MSG = T.let(T.unsafe(nil), String)2735# Checks that no class, module, or constant is declared.2736#2737# Constants, including classes and modules, when declared in a block2738# scope, are defined in global namespace, and leak between examples.2739#2740# If several examples may define a `DummyClass`, instead of being a2741# blank slate class as it will be in the first example, subsequent2742# examples will be reopening it and modifying its behavior in2743# unpredictable ways.2744# Even worse when a class that exists in the codebase is reopened.2745#2746# Anonymous classes are fine, since they don't result in global2747# namespace name clashes.2748#2749# @example Constants leak between examples2750# # bad2751# describe SomeClass do2752# OtherClass = Struct.new2753# CONSTANT_HERE = 'I leak into global namespace'2754# end2755#2756# # good2757# describe SomeClass do2758# before do2759# stub_const('OtherClass', Struct.new)2760# stub_const('CONSTANT_HERE', 'I only exist during this example')2761# end2762# end2763# @example2764# # bad2765# describe SomeClass do2766# class FooClass < described_class2767# def double_that2768# some_base_method * 22769# end2770# end2771#2772# it { expect(FooClass.new.double_that).to eq(4) }2773# end2774#2775# # good - anonymous class, no constant needs to be defined2776# describe SomeClass do2777# let(:foo_class) do2778# Class.new(described_class) do2779# def double_that2780# some_base_method * 22781# end2782# end2783# end2784#2785# it { expect(foo_class.new.double_that).to eq(4) }2786# end2787#2788# # good - constant is stubbed2789# describe SomeClass do2790# before do2791# foo_class = Class.new(described_class) do2792# def do_something2793# end2794# end2795# stub_const('FooClass', foo_class)2796# end2797#2798# it { expect(FooClass.new.double_that).to eq(4) }2799# end2800# @example2801# # bad2802# describe SomeClass do2803# module SomeModule2804# class SomeClass2805# def do_something2806# end2807# end2808# end2809# end2810#2811# # good2812# describe SomeClass do2813# before do2814# foo_class = Class.new(described_class) do2815# def do_something2816# end2817# end2818# stub_const('SomeModule::SomeClass', foo_class)2819# end2820# end2821# @see https://relishapp.com/rspec/rspec-mocks/docs/mutating-constants2822#2823# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leaky_constant_declaration.rb:962824class RuboCop::Cop::RSpec::LeakyConstantDeclaration < ::RuboCop::Cop::RSpec::Base2825 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leaky_constant_declaration.rb:1012826 def on_casgn(node); end2827 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leaky_constant_declaration.rb:1072828 def on_class(node); end2829 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leaky_constant_declaration.rb:1132830 def on_module(node); end2831 private2832 # @return [Boolean]2833 #2834 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leaky_constant_declaration.rb:1212835 def inside_describe_block?(node); end2836end2837# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leaky_constant_declaration.rb:982838RuboCop::Cop::RSpec::LeakyConstantDeclaration::MSG_CLASS = T.let(T.unsafe(nil), String)2839# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leaky_constant_declaration.rb:972840RuboCop::Cop::RSpec::LeakyConstantDeclaration::MSG_CONST = T.let(T.unsafe(nil), String)2841# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/leaky_constant_declaration.rb:992842RuboCop::Cop::RSpec::LeakyConstantDeclaration::MSG_MODULE = T.let(T.unsafe(nil), String)2843# Checks for `let` definitions that come after an example.2844#2845# @example2846# # Bad2847# let(:foo) { bar }2848#2849# it 'checks what foo does' do2850# expect(foo).to be2851# end2852#2853# let(:some) { other }2854#2855# it 'checks what some does' do2856# expect(some).to be2857# end2858#2859# # Good2860# let(:foo) { bar }2861# let(:some) { other }2862#2863# it 'checks what foo does' do2864# expect(foo).to be2865# end2866#2867# it 'checks what some does' do2868# expect(some).to be2869# end2870#2871# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_before_examples.rb:332872class RuboCop::Cop::RSpec::LetBeforeExamples < ::RuboCop::Cop::RSpec::Base2873 extend ::RuboCop::Cop::AutoCorrector2874 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_before_examples.rb:392875 def example_or_group?(param0 = T.unsafe(nil)); end2876 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_before_examples.rb:462877 def on_block(node); end2878 private2879 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_before_examples.rb:762880 def autocorrect(corrector, node, first_example); end2881 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_before_examples.rb:582882 def check_let_declarations(node); end2883 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_before_examples.rb:722884 def find_first_example(node); end2885 # @return [Boolean]2886 #2887 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_before_examples.rb:542888 def multiline_block?(block); end2889end2890# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_before_examples.rb:362891RuboCop::Cop::RSpec::LetBeforeExamples::MSG = T.let(T.unsafe(nil), String)2892# Checks unreferenced `let!` calls being used for test setup.2893#2894# @example2895# # Bad2896# let!(:my_widget) { create(:widget) }2897#2898# it 'counts widgets' do2899# expect(Widget.count).to eq(1)2900# end2901#2902# # Good2903# it 'counts widgets' do2904# create(:widget)2905# expect(Widget.count).to eq(1)2906# end2907#2908# # Good2909# before { create(:widget) }2910#2911# it 'counts widgets' do2912# expect(Widget.count).to eq(1)2913# end2914#2915# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_setup.rb:282916class RuboCop::Cop::RSpec::LetSetup < ::RuboCop::Cop::RSpec::Base2917 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_setup.rb:322918 def example_or_shared_group_or_including?(param0 = T.unsafe(nil)); end2919 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_setup.rb:422920 def let_bang(param0 = T.unsafe(nil)); end2921 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_setup.rb:502922 def method_called?(param0, param1); end2923 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_setup.rb:522924 def on_block(node); end2925 private2926 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_setup.rb:682927 def child_let_bang(node, &block); end2928 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_setup.rb:622929 def unused_let_bang(node); end2930end2931# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/let_setup.rb:292932RuboCop::Cop::RSpec::LetSetup::MSG = T.let(T.unsafe(nil), String)2933# Check that chains of messages are not being stubbed.2934#2935# @example2936# # bad2937# allow(foo).to receive_message_chain(:bar, :baz).and_return(42)2938#2939# # better2940# thing = Thing.new(baz: 42)2941# allow(foo).to receive(:bar).and_return(thing)2942#2943# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_chain.rb:162944class RuboCop::Cop::RSpec::MessageChain < ::RuboCop::Cop::RSpec::Base2945 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_chain.rb:202946 def on_send(node); end2947end2948# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_chain.rb:172949RuboCop::Cop::RSpec::MessageChain::MSG = T.let(T.unsafe(nil), String)2950# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_chain.rb:182951RuboCop::Cop::RSpec::MessageChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)2952# Checks for consistent message expectation style.2953#2954# This cop can be configured in your configuration using the2955# `EnforcedStyle` option and supports `--auto-gen-config`.2956#2957# @example `EnforcedStyle: allow` (default)2958#2959# # bad2960# expect(foo).to receive(:bar)2961#2962# # good2963# allow(foo).to receive(:bar)2964# @example `EnforcedStyle: expect`2965#2966# # bad2967# allow(foo).to receive(:bar)2968#2969# # good2970# expect(foo).to receive(:bar)2971#2972# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_expectation.rb:272973class RuboCop::Cop::RSpec::MessageExpectation < ::RuboCop::Cop::RSpec::Base2974 include ::RuboCop::Cop::ConfigurableEnforcedStyle2975 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_expectation.rb:362976 def message_expectation(param0 = T.unsafe(nil)); end2977 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_expectation.rb:432978 def on_send(node); end2979 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_expectation.rb:412980 def receive_message?(param0); end2981 private2982 # @return [Boolean]2983 #2984 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_expectation.rb:562985 def preferred_style?(expectation); end2986end2987# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_expectation.rb:302988RuboCop::Cop::RSpec::MessageExpectation::MSG = T.let(T.unsafe(nil), String)2989# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_expectation.rb:332990RuboCop::Cop::RSpec::MessageExpectation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)2991# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_expectation.rb:322992RuboCop::Cop::RSpec::MessageExpectation::SUPPORTED_STYLES = T.let(T.unsafe(nil), Array)2993# Checks that message expectations are set using spies.2994#2995# This cop can be configured in your configuration using the2996# `EnforcedStyle` option and supports `--auto-gen-config`.2997#2998# @example `EnforcedStyle: have_received` (default)2999#3000# # bad3001# expect(foo).to receive(:bar)3002# do_something3003#3004# # good3005# allow(foo).to receive(:bar) # or use instance_spy3006# do_something3007# expect(foo).to have_received(:bar)3008# @example `EnforcedStyle: receive`3009#3010# # bad3011# allow(foo).to receive(:bar)3012# do_something3013# expect(foo).to have_received(:bar)3014#3015# # good3016# expect(foo).to receive(:bar)3017# do_something3018#3019# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_spies.rb:333020class RuboCop::Cop::RSpec::MessageSpies < ::RuboCop::Cop::RSpec::Base3021 include ::RuboCop::Cop::ConfigurableEnforcedStyle3022 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_spies.rb:453023 def message_expectation(param0 = T.unsafe(nil)); end3024 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_spies.rb:543025 def on_send(node); end3026 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_spies.rb:503027 def receive_message(param0); end3028 private3029 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_spies.rb:773030 def error_message(receiver); end3031 # @return [Boolean]3032 #3033 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_spies.rb:733034 def preferred_style?(expectation); end3035 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_spies.rb:673036 def receive_message_matcher(node); end3037end3038# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_spies.rb:383039RuboCop::Cop::RSpec::MessageSpies::MSG_HAVE_RECEIVED = T.let(T.unsafe(nil), String)3040# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_spies.rb:363041RuboCop::Cop::RSpec::MessageSpies::MSG_RECEIVE = T.let(T.unsafe(nil), String)3042# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/message_spies.rb:423043RuboCop::Cop::RSpec::MessageSpies::SUPPORTED_STYLES = T.let(T.unsafe(nil), Array)3044# Checks that the first argument to an example group is not empty.3045#3046# @example3047# # bad3048# describe do3049# end3050#3051# RSpec.describe do3052# end3053#3054# # good3055# describe TestedClass do3056# end3057#3058# describe "A feature example" do3059# end3060#3061# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/missing_example_group_argument.rb:223062class RuboCop::Cop::RSpec::MissingExampleGroupArgument < ::RuboCop::Cop::RSpec::Base3063 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/missing_example_group_argument.rb:253064 def on_block(node); end3065end3066# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/missing_example_group_argument.rb:233067RuboCop::Cop::RSpec::MissingExampleGroupArgument::MSG = T.let(T.unsafe(nil), String)3068# Checks for multiple top-level example groups.3069#3070# Multiple descriptions for the same class or module should either3071# be nested or separated into different test files.3072#3073# @example3074# # bad3075# describe MyClass, '.do_something' do3076# end3077# describe MyClass, '.do_something_else' do3078# end3079#3080# # good3081# describe MyClass do3082# describe '.do_something' do3083# end3084# describe '.do_something_else' do3085# end3086# end3087#3088# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_describes.rb:253089class RuboCop::Cop::RSpec::MultipleDescribes < ::RuboCop::Cop::RSpec::Base3090 include ::RuboCop::Cop::RSpec::TopLevelGroup3091 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_describes.rb:303092 def on_top_level_group(node); end3093end3094# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_describes.rb:283095RuboCop::Cop::RSpec::MultipleDescribes::MSG = T.let(T.unsafe(nil), String)3096# Checks if examples contain too many `expect` calls.3097#3098# This cop is configurable using the `Max` option3099# and works with `--auto-gen-config`.3100#3101# @example3102#3103# # bad3104# describe UserCreator do3105# it 'builds a user' do3106# expect(user.name).to eq("John")3107# expect(user.age).to eq(22)3108# end3109# end3110#3111# # good3112# describe UserCreator do3113# it 'sets the users name' do3114# expect(user.name).to eq("John")3115# end3116#3117# it 'sets the users age' do3118# expect(user.age).to eq(22)3119# end3120# end3121# @example `aggregate_failures: true` (default)3122#3123# # good - the cop ignores when RSpec aggregates failures3124# describe UserCreator do3125# it 'builds a user', :aggregate_failures do3126# expect(user.name).to eq("John")3127# expect(user.age).to eq(22)3128# end3129# end3130# @example `aggregate_failures: false`3131#3132# # Detected as an offense3133# describe UserCreator do3134# it 'builds a user', aggregate_failures: false do3135# expect(user.name).to eq("John")3136# expect(user.age).to eq(22)3137# end3138# end3139# @example configuration3140#3141# # .rubocop.yml3142# # RSpec/MultipleExpectations:3143# # Max: 23144#3145# # not flagged by rubocop3146# describe UserCreator do3147# it 'builds a user' do3148# expect(user.name).to eq("John")3149# expect(user.age).to eq(22)3150# end3151# end3152# @see http://betterspecs.org/#single Single expectation test3153#3154# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_expectations.rb:683155class RuboCop::Cop::RSpec::MultipleExpectations < ::RuboCop::Cop::RSpec::Base3156 include ::RuboCop::Cop::ConfigurableMax3157 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_expectations.rb:773158 def aggregate_failures?(param0 = T.unsafe(nil), param1); end3159 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_expectations.rb:873160 def aggregate_failures_block?(param0 = T.unsafe(nil)); end3161 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_expectations.rb:853162 def expect?(param0 = T.unsafe(nil)); end3163 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_expectations.rb:913164 def on_block(node); end3165 private3166 # @return [Boolean]3167 #3168 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_expectations.rb:1073169 def example_with_aggregate_failures?(example_node); end3170 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_expectations.rb:1143171 def find_aggregate_failures(example_node); end3172 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_expectations.rb:1193173 def find_expectation(node, &block); end3174 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_expectations.rb:1303175 def flag_example(node, expectation_count:); end3176 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_expectations.rb:1413177 def max_expectations; end3178end3179# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_expectations.rb:733180RuboCop::Cop::RSpec::MultipleExpectations::ANYTHING = T.let(T.unsafe(nil), Proc)3181# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_expectations.rb:713182RuboCop::Cop::RSpec::MultipleExpectations::MSG = T.let(T.unsafe(nil), String)3183# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_expectations.rb:743184RuboCop::Cop::RSpec::MultipleExpectations::TRUE = T.let(T.unsafe(nil), Proc)3185# Checks if example groups contain too many `let` and `subject` calls.3186#3187# This cop is configurable using the `Max` option and the `AllowSubject`3188# which will configure the cop to only register offenses on calls to3189# `let` and not calls to `subject`.3190#3191# @example3192# # bad3193# describe MyClass do3194# let(:foo) { [] }3195# let(:bar) { [] }3196# let!(:baz) { [] }3197# let(:qux) { [] }3198# let(:quux) { [] }3199# let(:quuz) { {} }3200# end3201#3202# describe MyClass do3203# let(:foo) { [] }3204# let(:bar) { [] }3205# let!(:baz) { [] }3206#3207# context 'when stuff' do3208# let(:qux) { [] }3209# let(:quux) { [] }3210# let(:quuz) { {} }3211# end3212# end3213#3214# # good3215# describe MyClass do3216# let(:bar) { [] }3217# let!(:baz) { [] }3218# let(:qux) { [] }3219# let(:quux) { [] }3220# let(:quuz) { {} }3221# end3222#3223# describe MyClass do3224# context 'when stuff' do3225# let(:foo) { [] }3226# let(:bar) { [] }3227# let!(:booger) { [] }3228# end3229#3230# context 'when other stuff' do3231# let(:qux) { [] }3232# let(:quux) { [] }3233# let(:quuz) { {} }3234# end3235# end3236# @example when disabling AllowSubject configuration3237#3238# # rubocop.yml3239# # RSpec/MultipleMemoizedHelpers:3240# # AllowSubject: false3241#3242# # bad - `subject` counts towards memoized helpers3243# describe MyClass do3244# subject { {} }3245# let(:foo) { [] }3246# let(:bar) { [] }3247# let!(:baz) { [] }3248# let(:qux) { [] }3249# let(:quux) { [] }3250# end3251# @example with Max configuration3252#3253# # rubocop.yml3254# # RSpec/MultipleMemoizedHelpers:3255# # Max: 13256#3257# # bad3258# describe MyClass do3259# let(:foo) { [] }3260# let(:bar) { [] }3261# end3262#3263# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:863264class RuboCop::Cop::RSpec::MultipleMemoizedHelpers < ::RuboCop::Cop::RSpec::Base3265 include ::RuboCop::Cop::ConfigurableMax3266 include ::RuboCop::Cop::RSpec::Variable3267 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:923268 def on_block(node); end3269 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:1033270 def on_new_investigation; end3271 private3272 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:1123273 def all_helpers(node); end3274 # @return [Boolean]3275 #3276 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:1443277 def allow_subject?; end3278 # Returns the value of attribute example_group_memoized_helpers.3279 #3280 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:1103281 def example_group_memoized_helpers; end3282 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:1193283 def helpers(node); end3284 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:1403285 def max; end3286 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:1303287 def variable_nodes(node); end3288end3289# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_memoized_helpers.rb:903290RuboCop::Cop::RSpec::MultipleMemoizedHelpers::MSG = T.let(T.unsafe(nil), String)3291# Checks if an example group defines `subject` multiple times.3292#3293# The autocorrect behavior for this cop depends on the type of3294# duplication:3295#3296# - If multiple named subjects are defined then this probably indicates3297# that the overwritten subjects (all subjects except the last3298# definition) are effectively being used to define helpers. In this3299# case they are replaced with `let`.3300#3301# - If multiple unnamed subjects are defined though then this can *only*3302# be dead code and we remove the overwritten subject definitions.3303#3304# - If subjects are defined with `subject!` then we don't autocorrect.3305# This is enough of an edge case that people can just move this to3306# a `before` hook on their own3307#3308# @example3309#3310# # bad3311# describe Foo do3312# subject(:user) { User.new }3313# subject(:post) { Post.new }3314# end3315#3316# # good3317# describe Foo do3318# let(:user) { User.new }3319# subject(:post) { Post.new }3320# end3321#3322# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_subjects.rb:363323class RuboCop::Cop::RSpec::MultipleSubjects < ::RuboCop::Cop::RSpec::Base3324 include ::RuboCop::Cop::RangeHelp3325 extend ::RuboCop::Cop::AutoCorrector3326 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_subjects.rb:423327 def on_block(node); end3328 private3329 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_subjects.rb:563330 def autocorrect(corrector, subject); end3331 # @return [Boolean]3332 #3333 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_subjects.rb:663334 def named_subject?(node); end3335 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_subjects.rb:743336 def remove_autocorrect(corrector, node); end3337 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_subjects.rb:703338 def rename_autocorrect(corrector, node); end3339end3340# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/multiple_subjects.rb:403341RuboCop::Cop::RSpec::MultipleSubjects::MSG = T.let(T.unsafe(nil), String)3342# Checks for explicitly referenced test subjects.3343#3344# RSpec lets you declare an "implicit subject" using `subject { ... }`3345# which allows for tests like `it { is_expected.to be_valid }`.3346# If you need to reference your test subject you should explicitly3347# name it using `subject(:your_subject_name) { ... }`. Your test subjects3348# should be the most important object in your tests so they deserve3349# a descriptive name.3350#3351# This cop can be configured in your configuration using the3352# `IgnoreSharedExamples` which will not report offenses for implicit3353# subjects in shared example groups.3354#3355# @example3356# # bad3357# RSpec.describe User do3358# subject { described_class.new }3359#3360# it 'is valid' do3361# expect(subject.valid?).to be(true)3362# end3363# end3364#3365# # good3366# RSpec.describe Foo do3367# subject(:user) { described_class.new }3368#3369# it 'is valid' do3370# expect(user.valid?).to be(true)3371# end3372# end3373#3374# # also good3375# RSpec.describe Foo do3376# subject(:user) { described_class.new }3377#3378# it { is_expected.to be_valid }3379# end3380#3381# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/named_subject.rb:443382class RuboCop::Cop::RSpec::NamedSubject < ::RuboCop::Cop::RSpec::Base3383 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/named_subject.rb:483384 def example_or_hook_block?(param0 = T.unsafe(nil)); end3385 # @return [Boolean]3386 #3387 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/named_subject.rb:683388 def ignored_shared_example?(node); end3389 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/named_subject.rb:583390 def on_block(node); end3391 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/named_subject.rb:523392 def shared_example?(param0 = T.unsafe(nil)); end3393 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/named_subject.rb:563394 def subject_usage(param0); end3395end3396# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/named_subject.rb:453397RuboCop::Cop::RSpec::NamedSubject::MSG = T.let(T.unsafe(nil), String)3398# Checks for nested example groups.3399#3400# This cop is configurable using the `Max` option3401# and supports `--auto-gen-config`.3402#3403# @example3404# # bad3405# context 'when using some feature' do3406# let(:some) { :various }3407# let(:feature) { :setup }3408#3409# context 'when user is signed in' do # flagged by rubocop3410# let(:user) do3411# UserCreate.call(user_attributes)3412# end3413#3414# let(:user_attributes) do3415# {3416# name: 'John',3417# age: 22,3418# role: role3419# }3420# end3421#3422# context 'when user is an admin' do # flagged by rubocop3423# let(:role) { 'admin' }3424#3425# it 'blah blah'3426# it 'yada yada'3427# end3428# end3429# end3430#3431# # better3432# context 'using some feature as an admin' do3433# let(:some) { :various }3434# let(:feature) { :setup }3435#3436# let(:user) do3437# UserCreate.call(3438# name: 'John',3439# age: 22,3440# role: 'admin'3441# )3442# end3443#3444# it 'blah blah'3445# it 'yada yada'3446# end3447# @example configuration3448#3449# # .rubocop.yml3450# # RSpec/NestedGroups:3451# # Max: 23452#3453# context 'when using some feature' do3454# let(:some) { :various }3455# let(:feature) { :setup }3456#3457# context 'when user is signed in' do3458# let(:user) do3459# UserCreate.call(user_attributes)3460# end3461#3462# let(:user_attributes) do3463# {3464# name: 'John',3465# age: 22,3466# role: role3467# }3468# end3469#3470# context 'when user is an admin' do # flagged by rubocop3471# let(:role) { 'admin' }3472#3473# it 'blah blah'3474# it 'yada yada'3475# end3476# end3477# end3478#3479# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/nested_groups.rb:883480class RuboCop::Cop::RSpec::NestedGroups < ::RuboCop::Cop::RSpec::Base3481 include ::RuboCop::Cop::ConfigurableMax3482 include ::RuboCop::Cop::RSpec::TopLevelGroup3483 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/nested_groups.rb:1003484 def on_top_level_group(node); end3485 private3486 # @yield [node, nesting]3487 #3488 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/nested_groups.rb:1123489 def find_nested_example_groups(node, nesting: T.unsafe(nil), &block); end3490 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/nested_groups.rb:1273491 def max_nesting; end3492 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/nested_groups.rb:1313493 def max_nesting_config; end3494 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/nested_groups.rb:1233495 def message(nesting); end3496end3497# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/nested_groups.rb:943498RuboCop::Cop::RSpec::NestedGroups::DEPRECATED_MAX_KEY = T.let(T.unsafe(nil), String)3499# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/nested_groups.rb:963500RuboCop::Cop::RSpec::NestedGroups::DEPRECATION_WARNING = T.let(T.unsafe(nil), String)3501# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/nested_groups.rb:923502RuboCop::Cop::RSpec::NestedGroups::MSG = T.let(T.unsafe(nil), String)3503# Checks for consistent method usage for negating expectations.3504#3505# @example `EnforcedStyle: not_to` (default)3506#3507# # bad3508# it '...' do3509# expect(false).to_not be_true3510# end3511#3512# # good3513# it '...' do3514# expect(false).not_to be_true3515# end3516# @example `EnforcedStyle: to_not`3517#3518# # bad3519# it '...' do3520# expect(false).not_to be_true3521# end3522#3523# # good3524# it '...' do3525# expect(false).to_not be_true3526# end3527#3528# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/not_to_not.rb:313529class RuboCop::Cop::RSpec::NotToNot < ::RuboCop::Cop::RSpec::Base3530 include ::RuboCop::Cop::ConfigurableEnforcedStyle3531 extend ::RuboCop::Cop::AutoCorrector3532 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/not_to_not.rb:393533 def not_to_not_offense(param0 = T.unsafe(nil), param1); end3534 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/not_to_not.rb:413535 def on_send(node); end3536 private3537 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/not_to_not.rb:513538 def message(_node); end3539end3540# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/not_to_not.rb:353541RuboCop::Cop::RSpec::NotToNot::MSG = T.let(T.unsafe(nil), String)3542# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/not_to_not.rb:363543RuboCop::Cop::RSpec::NotToNot::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)3544# Checks if there is a let/subject that overwrites an existing one.3545#3546# @example3547# # bad3548# let(:foo) { bar }3549# let(:foo) { baz }3550#3551# subject(:foo) { bar }3552# let(:foo) { baz }3553#3554# let(:foo) { bar }3555# let!(:foo) { baz }3556#3557# # good3558# subject(:test) { something }3559# let(:foo) { bar }3560# let(:baz) { baz }3561# let!(:other) { other }3562#3563# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/overwriting_setup.rb:243564class RuboCop::Cop::RSpec::OverwritingSetup < ::RuboCop::Cop::RSpec::Base3565 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/overwriting_setup.rb:313566 def first_argument_name(param0 = T.unsafe(nil)); end3567 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/overwriting_setup.rb:333568 def on_block(node); end3569 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/overwriting_setup.rb:283570 def setup?(param0 = T.unsafe(nil)); end3571 private3572 # @return [Boolean]3573 #3574 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/overwriting_setup.rb:613575 def common_setup?(node); end3576 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/overwriting_setup.rb:463577 def find_duplicates(node); end3578end3579# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/overwriting_setup.rb:253580RuboCop::Cop::RSpec::OverwritingSetup::MSG = T.let(T.unsafe(nil), String)3581# Checks for any pending or skipped examples.3582#3583# @example3584# # bad3585# describe MyClass do3586# it "should be true"3587# end3588#3589# describe MyClass do3590# it "should be true", skip: true do3591# expect(1).to eq(2)3592# end3593# end3594#3595# describe MyClass do3596# it "should be true" do3597# pending3598# end3599# end3600#3601# describe MyClass do3602# xit "should be true" do3603# end3604# end3605#3606# # good3607# describe MyClass do3608# end3609#3610# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/pending.rb:343611class RuboCop::Cop::RSpec::Pending < ::RuboCop::Cop::RSpec::Base3612 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/pending.rb:643613 def on_send(node); end3614 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/pending.rb:553615 def pending_block?(param0 = T.unsafe(nil)); end3616 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/pending.rb:523617 def skip_or_pending?(param0 = T.unsafe(nil)); end3618 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/pending.rb:383619 def skippable?(param0 = T.unsafe(nil)); end3620 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/pending.rb:443621 def skipped_in_metadata?(param0 = T.unsafe(nil)); end3622 private3623 # @return [Boolean]3624 #3625 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/pending.rb:723626 def skipped?(node); end3627end3628# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/pending.rb:353629RuboCop::Cop::RSpec::Pending::MSG = T.let(T.unsafe(nil), String)3630# Prefer using predicate matcher over using predicate method directly.3631#3632# RSpec defines magic matchers for predicate methods.3633# This cop recommends to use the predicate matcher instead of using3634# predicate method directly.3635#3636# @example Strict: true, EnforcedStyle: inflected (default)3637# # bad3638# expect(foo.something?).to be_truthy3639#3640# # good3641# expect(foo).to be_something3642#3643# # also good - It checks "true" strictly.3644# expect(foo.something?).to be(true)3645# @example Strict: false, EnforcedStyle: inflected3646# # bad3647# expect(foo.something?).to be_truthy3648# expect(foo.something?).to be(true)3649#3650# # good3651# expect(foo).to be_something3652# @example Strict: true, EnforcedStyle: explicit3653# # bad3654# expect(foo).to be_something3655#3656# # good - the above code is rewritten to it by this cop3657# expect(foo.something?).to be(true)3658# @example Strict: false, EnforcedStyle: explicit3659# # bad3660# expect(foo).to be_something3661#3662# # good - the above code is rewritten to it by this cop3663# expect(foo.something?).to be_truthy3664#3665# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:2793666class RuboCop::Cop::RSpec::PredicateMatcher < ::RuboCop::Cop::RSpec::Base3667 include ::RuboCop::Cop::ConfigurableEnforcedStyle3668 include ::RuboCop::Cop::RSpec::InflectedHelper3669 include ::RuboCop::Cop::RSpec::ExplicitHelper3670 extend ::RuboCop::Cop::AutoCorrector3671 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:2943672 def on_block(node); end3673 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:2853674 def on_send(node); end3675 private3676 # returns args location with whitespace3677 #3678 # @example3679 # foo 1, 23680 # ^^^^^3681 #3682 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:3043683 def args_loc(send_node); end3684 # returns block location with whitespace3685 #3686 # @example3687 # foo { bar }3688 # ^^^^^^^^3689 #3690 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/predicate_matcher.rb:3143691 def block_loc(send_node); end3692end3693# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb:63694module RuboCop::Cop::RSpec::Rails; end3695# Checks that tests use RSpec `before` hook over Rails `setup` method.3696#3697# @example3698#3699# # bad3700# setup do3701# allow(foo).to receive(:bar)3702# end3703#3704# # good3705# before do3706# allow(foo).to receive(:bar)3707# end3708#3709# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb:213710class RuboCop::Cop::RSpec::Rails::AvoidSetupHook < ::RuboCop::Cop::RSpec::Base3711 extend ::RuboCop::Cop::AutoCorrector3712 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb:333713 def on_block(node); end3714 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb:273715 def setup_call(param0 = T.unsafe(nil)); end3716end3717# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb:243718RuboCop::Cop::RSpec::Rails::AvoidSetupHook::MSG = T.let(T.unsafe(nil), String)3719# Checks that tests use `have_http_status` instead of equality matchers.3720#3721# @example3722# # bad3723# expect(response.status).to be(200)3724#3725# # good3726# expect(response).to have_http_status(200)3727#3728# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/rails/have_http_status.rb:163729class RuboCop::Cop::RSpec::Rails::HaveHttpStatus < ::RuboCop::Cop::RSpec::Base3730 extend ::RuboCop::Cop::AutoCorrector3731 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/rails/have_http_status.rb:243732 def match_status(param0 = T.unsafe(nil)); end3733 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/rails/have_http_status.rb:343734 def on_send(node); end3735end3736# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/rails/have_http_status.rb:193737RuboCop::Cop::RSpec::Rails::HaveHttpStatus::MSG = T.let(T.unsafe(nil), String)3738# Check for `once` and `twice` receive counts matchers usage.3739#3740# @example3741#3742# # bad3743# expect(foo).to receive(:bar).exactly(1).times3744# expect(foo).to receive(:bar).exactly(2).times3745# expect(foo).to receive(:bar).at_least(1).times3746# expect(foo).to receive(:bar).at_least(2).times3747# expect(foo).to receive(:bar).at_most(1).times3748# expect(foo).to receive(:bar).at_most(2).times3749#3750# # good3751# expect(foo).to receive(:bar).once3752# expect(foo).to receive(:bar).twice3753# expect(foo).to receive(:bar).at_least(:once)3754# expect(foo).to receive(:bar).at_least(:twice)3755# expect(foo).to receive(:bar).at_most(:once)3756# expect(foo).to receive(:bar).at_most(:twice).times3757#3758# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_counts.rb:263759class RuboCop::Cop::RSpec::ReceiveCounts < ::RuboCop::Cop::RSpec::Base3760 extend ::RuboCop::Cop::AutoCorrector3761 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_counts.rb:413762 def on_send(node); end3763 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_counts.rb:343764 def receive_counts(param0 = T.unsafe(nil)); end3765 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_counts.rb:393766 def stub?(param0); end3767 private3768 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_counts.rb:563769 def autocorrect(corrector, node, range); end3770 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_counts.rb:733771 def matcher_for(method, count); end3772 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_counts.rb:653773 def message_for(node, source); end3774 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_counts.rb:823775 def range(node, offending_node); end3776end3777# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_counts.rb:293778RuboCop::Cop::RSpec::ReceiveCounts::MSG = T.let(T.unsafe(nil), String)3779# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_counts.rb:313780RuboCop::Cop::RSpec::ReceiveCounts::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)3781# Prefer `not_to receive(...)` over `receive(...).never`.3782#3783# @example3784#3785# # bad3786# expect(foo).to receive(:bar).never3787#3788# # good3789# expect(foo).not_to receive(:bar)3790#3791# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_never.rb:163792class RuboCop::Cop::RSpec::ReceiveNever < ::RuboCop::Cop::RSpec::Base3793 extend ::RuboCop::Cop::AutoCorrector3794 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_never.rb:223795 def method_on_stub?(param0); end3796 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_never.rb:243797 def on_send(node); end3798 private3799 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_never.rb:343800 def autocorrect(corrector, node); end3801end3802# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_never.rb:183803RuboCop::Cop::RSpec::ReceiveNever::MSG = T.let(T.unsafe(nil), String)3804# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/receive_never.rb:193805RuboCop::Cop::RSpec::ReceiveNever::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)3806# Check for repeated description strings in example groups.3807#3808# @example3809#3810# # bad3811# RSpec.describe User do3812# it 'is valid' do3813# # ...3814# end3815#3816# it 'is valid' do3817# # ...3818# end3819# end3820#3821# # good3822# RSpec.describe User do3823# it 'is valid when first and last name are present' do3824# # ...3825# end3826#3827# it 'is valid when last name only is present' do3828# # ...3829# end3830# end3831#3832# # good3833# RSpec.describe User do3834# it 'is valid' do3835# # ...3836# end3837#3838# it 'is valid', :flag do3839# # ...3840# end3841# end3842#3843# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_description.rb:433844class RuboCop::Cop::RSpec::RepeatedDescription < ::RuboCop::Cop::RSpec::Base3845 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_description.rb:463846 def on_block(node); end3847 private3848 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_description.rb:703849 def example_signature(example); end3850 # Select examples in the current scope with repeated description strings3851 #3852 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_description.rb:573853 def repeated_descriptions(node); end3854end3855# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_description.rb:443856RuboCop::Cop::RSpec::RepeatedDescription::MSG = T.let(T.unsafe(nil), String)3857# Check for repeated examples within example groups.3858#3859# @example3860#3861# it 'is valid' do3862# expect(user).to be_valid3863# end3864#3865# it 'validates the user' do3866# expect(user).to be_valid3867# end3868#3869# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example.rb:183870class RuboCop::Cop::RSpec::RepeatedExample < ::RuboCop::Cop::RSpec::Base3871 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example.rb:213872 def on_block(node); end3873 private3874 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example.rb:413875 def example_signature(example); end3876 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example.rb:313877 def repeated_examples(node); end3878end3879# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example.rb:193880RuboCop::Cop::RSpec::RepeatedExample::MSG = T.let(T.unsafe(nil), String)3881# Check for repeated describe and context block body.3882#3883# @example3884#3885# # bad3886# describe 'cool feature x' do3887# it { cool_predicate }3888# end3889#3890# describe 'cool feature y' do3891# it { cool_predicate }3892# end3893#3894# # good3895# describe 'cool feature' do3896# it { cool_predicate }3897# end3898#3899# describe 'another cool feature' do3900# it { another_predicate }3901# end3902#3903# # good3904# context 'when case x', :tag do3905# it { cool_predicate }3906# end3907#3908# context 'when case y' do3909# it { cool_predicate }3910# end3911#3912# # good3913# context Array do3914# it { is_expected.to respond_to :each }3915# end3916#3917# context Hash do3918# it { is_expected.to respond_to :each }3919# end3920#3921# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb:463922class RuboCop::Cop::RSpec::RepeatedExampleGroupBody < ::RuboCop::Cop::RSpec::Base3923 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb:583924 def body(param0 = T.unsafe(nil)); end3925 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb:613926 def const_arg(param0 = T.unsafe(nil)); end3927 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb:553928 def metadata(param0 = T.unsafe(nil)); end3929 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb:683930 def on_begin(node); end3931 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb:503932 def several_example_groups?(param0 = T.unsafe(nil)); end3933 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb:643934 def skip_or_pending?(param0 = T.unsafe(nil)); end3935 private3936 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb:893937 def add_repeated_lines(groups); end3938 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb:983939 def message(group, repeats); end3940 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb:783941 def repeated_group_bodies(node); end3942 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb:943943 def signature_keys(group); end3944end3945# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_body.rb:473946RuboCop::Cop::RSpec::RepeatedExampleGroupBody::MSG = T.let(T.unsafe(nil), String)3947# Check for repeated example group descriptions.3948#3949# @example3950#3951# # bad3952# describe 'cool feature' do3953# # example group3954# end3955#3956# describe 'cool feature' do3957# # example group3958# end3959#3960# # bad3961# context 'when case x' do3962# # example group3963# end3964#3965# describe 'when case x' do3966# # example group3967# end3968#3969# # good3970# describe 'cool feature' do3971# # example group3972# end3973#3974# describe 'another cool feature' do3975# # example group3976# end3977#3978# # good3979# context 'when case x' do3980# # example group3981# end3982#3983# context 'when another case' do3984# # example group3985# end3986#3987# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_description.rb:463988class RuboCop::Cop::RSpec::RepeatedExampleGroupDescription < ::RuboCop::Cop::RSpec::Base3989 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_description.rb:553990 def doc_string_and_metadata(param0 = T.unsafe(nil)); end3991 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_description.rb:653992 def empty_description?(param0 = T.unsafe(nil)); end3993 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_description.rb:673994 def on_begin(node); end3995 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_description.rb:503996 def several_example_groups?(param0 = T.unsafe(nil)); end3997 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_description.rb:603998 def skip_or_pending?(param0 = T.unsafe(nil)); end3999 private4000 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_description.rb:894001 def add_repeated_lines(groups); end4002 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_description.rb:944003 def message(group, repeats); end4004 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_description.rb:774005 def repeated_group_descriptions(node); end4006end4007# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_example_group_description.rb:474008RuboCop::Cop::RSpec::RepeatedExampleGroupDescription::MSG = T.let(T.unsafe(nil), String)4009# Check for repeated include of shared examples.4010#4011# @example4012#4013# # bad4014# describe 'foo' do4015# include_examples 'cool stuff'4016# include_examples 'cool stuff'4017# end4018#4019# # bad4020# describe 'foo' do4021# it_behaves_like 'a cool', 'thing'4022# it_behaves_like 'a cool', 'thing'4023# end4024#4025# # bad4026# context 'foo' do4027# it_should_behave_like 'a duck'4028# it_should_behave_like 'a duck'4029# end4030#4031# # good4032# describe 'foo' do4033# include_examples 'cool stuff'4034# end4035#4036# describe 'bar' do4037# include_examples 'cool stuff'4038# end4039#4040# # good4041# describe 'foo' do4042# it_behaves_like 'a cool', 'thing'4043# it_behaves_like 'a cool', 'person'4044# end4045#4046# # good4047# context 'foo' do4048# it_should_behave_like 'a duck'4049# it_should_behave_like 'a goose'4050# end4051#4052# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_include_example.rb:494053class RuboCop::Cop::RSpec::RepeatedIncludeExample < ::RuboCop::Cop::RSpec::Base4054 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_include_example.rb:594055 def include_examples?(param0 = T.unsafe(nil)); end4056 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_include_example.rb:674057 def on_begin(node); end4058 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_include_example.rb:544059 def several_include_examples?(param0 = T.unsafe(nil)); end4060 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_include_example.rb:634061 def shared_examples_name(param0 = T.unsafe(nil)); end4062 private4063 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_include_example.rb:924064 def add_repeated_lines(items); end4065 # @return [Boolean]4066 #4067 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_include_example.rb:874068 def literal_include_examples?(node); end4069 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_include_example.rb:1014070 def message(item, repeats); end4071 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_include_example.rb:774072 def repeated_include_examples(node); end4073 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_include_example.rb:974074 def signature_keys(item); end4075end4076# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/repeated_include_example.rb:504077RuboCop::Cop::RSpec::RepeatedIncludeExample::MSG = T.let(T.unsafe(nil), String)4078# Checks for consistent style of stub's return setting.4079#4080# Enforces either `and_return` or block-style return in the cases4081# where the returned value is constant. Ignores dynamic returned values4082# are the result would be different4083#4084# This cop can be configured using the `EnforcedStyle` option4085#4086# @example `EnforcedStyle: and_return` (default)4087# # bad4088# allow(Foo).to receive(:bar) { "baz" }4089# expect(Foo).to receive(:bar) { "baz" }4090#4091# # good4092# allow(Foo).to receive(:bar).and_return("baz")4093# expect(Foo).to receive(:bar).and_return("baz")4094# # also good as the returned value is dynamic4095# allow(Foo).to receive(:bar) { bar.baz }4096# @example `EnforcedStyle: block`4097# # bad4098# allow(Foo).to receive(:bar).and_return("baz")4099# expect(Foo).to receive(:bar).and_return("baz")4100#4101# # good4102# allow(Foo).to receive(:bar) { "baz" }4103# expect(Foo).to receive(:bar) { "baz" }4104# # also good as the returned value is dynamic4105# allow(Foo).to receive(:bar).and_return(bar.baz)4106#4107# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:364108class RuboCop::Cop::RSpec::ReturnFromStub < ::RuboCop::Cop::RSpec::Base4109 include ::RuboCop::Cop::ConfigurableEnforcedStyle4110 extend ::RuboCop::Cop::AutoCorrector4111 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:514112 def and_return_value(param0); end4113 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:454114 def contains_stub?(param0); end4115 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:624116 def on_block(node); end4117 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:554118 def on_send(node); end4119 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:484120 def stub_with_block?(param0 = T.unsafe(nil)); end4121 private4122 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:714123 def check_and_return_call(node); end4124 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:814125 def check_block_body(block); end4126 # @return [Boolean]4127 #4128 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:904129 def dynamic?(node); end4130end4131# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:954132class RuboCop::Cop::RSpec::ReturnFromStub::AndReturnCallCorrector4133 # @return [AndReturnCallCorrector] a new instance of AndReturnCallCorrector4134 #4135 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:964136 def initialize(node); end4137 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:1024138 def call(corrector); end4139 private4140 # Returns the value of attribute arg.4141 #4142 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:1114143 def arg; end4144 # @return [Boolean]4145 #4146 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:1334147 def hash_without_braces?; end4148 # @return [Boolean]4149 #4150 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:1134151 def heredoc?; end4152 # Returns the value of attribute node.4153 #4154 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:1114155 def node; end4156 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:1174157 def range; end4158 # Returns the value of attribute receiver.4159 #4160 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:1114161 def receiver; end4162 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:1254163 def replacement; end4164end4165# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:1394166class RuboCop::Cop::RSpec::ReturnFromStub::BlockBodyCorrector4167 # @return [BlockBodyCorrector] a new instance of BlockBodyCorrector4168 #4169 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:1404170 def initialize(block); end4171 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:1464172 def call(corrector); end4173 private4174 # Returns the value of attribute block.4175 #4176 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:1584177 def block; end4178 # Returns the value of attribute body.4179 #4180 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:1584181 def body; end4182 # @return [Boolean]4183 #4184 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:1604185 def heredoc?; end4186 # Returns the value of attribute node.4187 #4188 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:1584189 def node; end4190end4191# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:1644192RuboCop::Cop::RSpec::ReturnFromStub::BlockBodyCorrector::NULL_BLOCK_BODY = T.let(T.unsafe(nil), T.untyped)4193# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:404194RuboCop::Cop::RSpec::ReturnFromStub::MSG_AND_RETURN = T.let(T.unsafe(nil), String)4195# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:414196RuboCop::Cop::RSpec::ReturnFromStub::MSG_BLOCK = T.let(T.unsafe(nil), String)4197# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/return_from_stub.rb:424198RuboCop::Cop::RSpec::ReturnFromStub::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)4199# Checks for let scattered across the example group.4200#4201# Group lets together4202#4203# @example4204# # bad4205# describe Foo do4206# let(:foo) { 1 }4207# subject { Foo }4208# let(:bar) { 2 }4209# before { prepare }4210# let!(:baz) { 3 }4211# end4212#4213# # good4214# describe Foo do4215# subject { Foo }4216# before { prepare }4217# let(:foo) { 1 }4218# let(:bar) { 2 }4219# let!(:baz) { 3 }4220# end4221#4222# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/scattered_let.rb:294223class RuboCop::Cop::RSpec::ScatteredLet < ::RuboCop::Cop::RSpec::Base4224 extend ::RuboCop::Cop::AutoCorrector4225 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/scattered_let.rb:344226 def on_block(node); end4227 private4228 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/scattered_let.rb:424229 def check_let_declarations(body); end4230 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/scattered_let.rb:574231 def find_first_let(node); end4232end4233# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/scattered_let.rb:324234RuboCop::Cop::RSpec::ScatteredLet::MSG = T.let(T.unsafe(nil), String)4235# Checks for setup scattered across multiple hooks in an example group.4236#4237# Unify `before`, `after`, and `around` hooks when possible.4238#4239# @example4240# # bad4241# describe Foo do4242# before { setup1 }4243# before { setup2 }4244# end4245#4246# # good4247# describe Foo do4248# before do4249# setup14250# setup24251# end4252# end4253#4254# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/scattered_setup.rb:254255class RuboCop::Cop::RSpec::ScatteredSetup < ::RuboCop::Cop::RSpec::Base4256 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/scattered_setup.rb:574257 def lines_msg(numbers); end4258 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/scattered_setup.rb:294259 def on_block(node); end4260 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/scattered_setup.rb:444261 def repeated_hooks(node); end4262end4263# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/scattered_setup.rb:264264RuboCop::Cop::RSpec::ScatteredSetup::MSG = T.let(T.unsafe(nil), String)4265# Checks for proper shared_context and shared_examples usage.4266#4267# If there are no examples defined, use shared_context.4268# If there is no setup defined, use shared_examples.4269#4270# @example4271# # bad4272# RSpec.shared_context 'only examples here' do4273# it 'does x' do4274# end4275#4276# it 'does y' do4277# end4278# end4279#4280# # good4281# RSpec.shared_examples 'only examples here' do4282# it 'does x' do4283# end4284#4285# it 'does y' do4286# end4287# end4288# @example4289# # bad4290# RSpec.shared_examples 'only setup here' do4291# subject(:foo) { :bar }4292#4293# let(:baz) { :bazz }4294#4295# before do4296# something4297# end4298# end4299#4300# # good4301# RSpec.shared_context 'only setup here' do4302# subject(:foo) { :bar }4303#4304# let(:baz) { :bazz }4305#4306# before do4307# something4308# end4309# end4310#4311# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_context.rb:534312class RuboCop::Cop::RSpec::SharedContext < ::RuboCop::Cop::RSpec::Base4313 extend ::RuboCop::Cop::AutoCorrector4314 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_context.rb:644315 def context?(param0); end4316 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_context.rb:604317 def examples?(param0); end4318 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_context.rb:824319 def on_block(node); end4320 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_context.rb:764321 def shared_context(param0 = T.unsafe(nil)); end4322 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_context.rb:794323 def shared_example(param0 = T.unsafe(nil)); end4324 private4325 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_context.rb:984326 def context_with_only_examples(node); end4327 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_context.rb:1024328 def examples_with_only_context(node); end4329end4330# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_context.rb:574331RuboCop::Cop::RSpec::SharedContext::MSG_CONTEXT = T.let(T.unsafe(nil), String)4332# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_context.rb:564333RuboCop::Cop::RSpec::SharedContext::MSG_EXAMPLES = T.let(T.unsafe(nil), String)4334# Enforces use of string to titleize shared examples.4335#4336# @example4337# # bad4338# it_behaves_like :foo_bar_baz4339# it_should_behave_like :foo_bar_baz4340# shared_examples :foo_bar_baz4341# shared_examples_for :foo_bar_baz4342# include_examples :foo_bar_baz4343#4344# # good4345# it_behaves_like 'foo bar baz'4346# it_should_behave_like 'foo bar baz'4347# shared_examples 'foo bar baz'4348# shared_examples_for 'foo bar baz'4349# include_examples 'foo bar baz'4350#4351# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_examples.rb:234352class RuboCop::Cop::RSpec::SharedExamples < ::RuboCop::Cop::RSpec::Base4353 extend ::RuboCop::Cop::AutoCorrector4354 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_examples.rb:324355 def on_send(node); end4356 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_examples.rb:274357 def shared_examples(param0 = T.unsafe(nil)); end4358end4359# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_examples.rb:454360class RuboCop::Cop::RSpec::SharedExamples::Checker4361 # @return [Checker] a new instance of Checker4362 #4363 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_examples.rb:514364 def initialize(node); end4365 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_examples.rb:554366 def message; end4367 # Returns the value of attribute node.4368 #4369 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_examples.rb:494370 def node; end4371 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_examples.rb:594372 def preferred_style; end4373 private4374 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_examples.rb:664375 def symbol; end4376 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_examples.rb:704377 def wrap_with_single_quotes(string); end4378end4379# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/shared_examples.rb:464380RuboCop::Cop::RSpec::SharedExamples::Checker::MSG = T.let(T.unsafe(nil), String)4381# Checks that chains of messages contain more than one element.4382#4383# @example4384# # bad4385# allow(foo).to receive_message_chain(:bar).and_return(42)4386#4387# # good4388# allow(foo).to receive(:bar).and_return(42)4389#4390# # also good4391# allow(foo).to receive(:bar, :baz)4392# allow(foo).to receive("bar.baz")4393#4394# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb:194395class RuboCop::Cop::RSpec::SingleArgumentMessageChain < ::RuboCop::Cop::RSpec::Base4396 extend ::RuboCop::Cop::AutoCorrector4397 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb:274398 def message_chain(param0 = T.unsafe(nil)); end4399 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb:344400 def on_send(node); end4401 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb:324402 def single_key_hash?(param0 = T.unsafe(nil)); end4403 private4404 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb:494405 def autocorrect(corrector, node, method, arg); end4406 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb:774407 def autocorrect_array_arg(corrector, arg); end4408 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb:694409 def autocorrect_hash_arg(corrector, arg); end4410 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb:834411 def key_to_arg(node); end4412 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb:884413 def replacement(method); end4414 # @return [Boolean]4415 #4416 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb:654417 def single_element_array?(node); end4418 # @return [Boolean]4419 #4420 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb:554421 def valid_usage?(node); end4422end4423# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb:224424RuboCop::Cop::RSpec::SingleArgumentMessageChain::MSG = T.let(T.unsafe(nil), String)4425# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/single_argument_message_chain.rb:244426RuboCop::Cop::RSpec::SingleArgumentMessageChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)4427# Checks that message expectations do not have a configured response.4428#4429# @example4430#4431# # bad4432# expect(foo).to receive(:bar).with(42).and_return("hello world")4433#4434# # good (without spies)4435# allow(foo).to receive(:bar).with(42).and_return("hello world")4436# expect(foo).to receive(:bar).with(42)4437#4438# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/stubbed_mock.rb:174439class RuboCop::Cop::RSpec::StubbedMock < ::RuboCop::Cop::RSpec::Base4440 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/stubbed_mock.rb:434441 def configured_response?(param0 = T.unsafe(nil)); end4442 # Match expectation4443 #4444 # @example source that matches4445 # is_expected.to be_in_the_bar4446 # @example source that matches4447 # expect(cocktail).to contain_exactly(:fresh_orange_juice, :campari)4448 # @example source that matches4449 # expect_any_instance_of(Officer).to be_alert4450 # @param node [RuboCop::AST::Node]4451 # @yield [RuboCop::AST::Node] expectation, method name, matcher4452 #4453 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/stubbed_mock.rb:624454 def expectation(param0 = T.unsafe(nil)); end4455 # Match matcher with a configured response in block-pass4456 #4457 # @example source that matches4458 # receive(:foo, &canned)4459 # @example source that matches4460 # receive_message_chain(:foo, :bar, &canned)4461 # @example source that matches4462 # receive(:foo).with('bar', &canned)4463 # @param node [RuboCop::AST::Node]4464 # @yield [RuboCop::AST::Node] matcher4465 #4466 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/stubbed_mock.rb:1304467 def matcher_with_blockpass(param0 = T.unsafe(nil)); end4468 # Match matcher with a configured response4469 #4470 # @example source that matches4471 # receive(:foo).and_return('bar')4472 # @example source that matches4473 # receive(:lower).and_raise(SomeError)4474 # @example source that matches4475 # receive(:redirect).and_call_original4476 # @param node [RuboCop::AST::Node]4477 # @yield [RuboCop::AST::Node] matcher4478 #4479 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/stubbed_mock.rb:824480 def matcher_with_configured_response(param0 = T.unsafe(nil)); end4481 # Match matcher with a configured response defined as a hash4482 #4483 # @example source that matches4484 # receive_messages(foo: 'bar', baz: 'qux')4485 # @example source that matches4486 # receive_message_chain(:foo, bar: 'baz')4487 # @param node [RuboCop::AST::Node]4488 # @yield [RuboCop::AST::Node] matcher4489 #4490 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/stubbed_mock.rb:1094491 def matcher_with_hash(param0 = T.unsafe(nil)); end4492 # Match matcher with a return block4493 #4494 # @example source that matches4495 # receive(:foo) { 'bar' }4496 # @param node [RuboCop::AST::Node]4497 # @yield [RuboCop::AST::Node] matcher4498 #4499 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/stubbed_mock.rb:944500 def matcher_with_return_block(param0 = T.unsafe(nil)); end4501 # Match message expectation matcher4502 #4503 # @example source that matches4504 # receive(:foo)4505 # @example source that matches4506 # receive_message_chain(:foo, :bar)4507 # @example source that matches4508 # receive(:foo).with('bar')4509 # @param node [RuboCop::AST::Node]4510 # @return [Array<RuboCop::AST::Node>] matching nodes4511 #4512 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/stubbed_mock.rb:354513 def message_expectation?(param0 = T.unsafe(nil)); end4514 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/stubbed_mock.rb:1374515 def on_send(node); end4516 private4517 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/stubbed_mock.rb:1544518 def msg(method_name); end4519 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/stubbed_mock.rb:1434520 def on_expectation(expectation, method_name, matcher); end4521 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/stubbed_mock.rb:1604522 def replacement(method_name); end4523end4524# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/stubbed_mock.rb:184525RuboCop::Cop::RSpec::StubbedMock::MSG = T.let(T.unsafe(nil), String)4526# Ensure that subject is defined using subject helper.4527#4528# @example4529#4530# # bad4531# let(:subject) { foo }4532# let!(:subject) { foo }4533# subject(:subject) { foo }4534# subject!(:subject) { foo }4535#4536# # bad4537# block = -> {}4538# let(:subject, &block)4539#4540# # good4541# subject(:test_subject) { foo }4542#4543# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_declaration.rb:234544class RuboCop::Cop::RSpec::SubjectDeclaration < ::RuboCop::Cop::RSpec::Base4545 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_declaration.rb:284546 def offensive_subject_declaration?(param0 = T.unsafe(nil)); end4547 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_declaration.rb:324548 def on_send(node); end4549 private4550 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_declaration.rb:414551 def message_for(offense); end4552end4553# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_declaration.rb:244554RuboCop::Cop::RSpec::SubjectDeclaration::MSG_LET = T.let(T.unsafe(nil), String)4555# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_declaration.rb:254556RuboCop::Cop::RSpec::SubjectDeclaration::MSG_REDUNDANT = T.let(T.unsafe(nil), String)4557# Checks for stubbed test subjects.4558#4559# Checks nested subject stubs for innermost subject definition4560# when subject is also defined in parent example groups.4561#4562# @example4563# # bad4564# describe Article do4565# subject(:article) { Article.new }4566#4567# it 'indicates that the author is unknown' do4568# allow(article).to receive(:author).and_return(nil)4569# expect(article.description).to include('by an unknown author')4570# end4571# end4572#4573# # bad4574# describe Article do4575# subject(:foo) { Article.new }4576#4577# context 'nested subject' do4578# subject(:article) { Article.new }4579#4580# it 'indicates that the author is unknown' do4581# allow(article).to receive(:author).and_return(nil)4582# expect(article.description).to include('by an unknown author')4583# end4584# end4585# end4586#4587# # good4588# describe Article do4589# subject(:article) { Article.new(author: nil) }4590#4591# it 'indicates that the author is unknown' do4592# expect(article.description).to include('by an unknown author')4593# end4594# end4595# @see https://robots.thoughtbot.com/don-t-stub-the-system-under-test4596# @see https://samphippen.com/introducing-rspec-smells-and-where-to-find-them#smell-1-stubject4597# @see https://github.com/rubocop-hq/rspec-style-guide#dont-stub-subject4598#4599# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_stub.rb:514600class RuboCop::Cop::RSpec::SubjectStub < ::RuboCop::Cop::RSpec::Base4601 include ::RuboCop::Cop::RSpec::TopLevelGroup4602 # Find a memoized helper4603 #4604 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_stub.rb:814605 def let?(param0 = T.unsafe(nil)); end4606 # Match `allow` and `expect(...).to receive`4607 #4608 # @example source that matches4609 # allow(foo).to receive(:bar)4610 # allow(foo).to receive(:bar).with(1)4611 # allow(foo).to receive(:bar).with(1).and_return(2)4612 # expect(foo).to receive(:bar)4613 # expect(foo).to receive(:bar).with(1)4614 # expect(foo).to receive(:bar).with(1).and_return(2)4615 #4616 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_stub.rb:984617 def message_expectation?(param0 = T.unsafe(nil), param1); end4618 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_stub.rb:1104619 def message_expectation_matcher?(param0); end4620 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_stub.rb:1164621 def on_top_level_group(node); end4622 # Find a named or unnamed subject definition4623 #4624 # @example anonymous subject4625 # subject?(parse('subject { foo }').ast) do |name|4626 # name # => :subject4627 # end4628 # @example named subject4629 # subject?(parse('subject(:thing) { foo }').ast) do |name|4630 # name # => :thing4631 # end4632 # @param node [RuboCop::AST::Node]4633 # @yield [Symbol] subject name4634 #4635 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_stub.rb:724636 def subject?(param0 = T.unsafe(nil)); end4637 private4638 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_stub.rb:1274639 def find_all_explicit(node); end4640 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_stub.rb:1414641 def find_subject_expectations(node, subject_names = T.unsafe(nil), &block); end4642end4643# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/subject_stub.rb:544644RuboCop::Cop::RSpec::SubjectStub::MSG = T.let(T.unsafe(nil), String)4645# Helper methods for top level example group cops4646#4647# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/top_level_group.rb:74648module RuboCop::Cop::RSpec::TopLevelGroup4649 extend ::RuboCop::AST::NodePattern::Macros4650 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/top_level_group.rb:104651 def on_new_investigation; end4652 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/top_level_group.rb:194653 def top_level_groups; end4654 private4655 # Dummy methods to be overridden in the consumer4656 #4657 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/top_level_group.rb:274658 def on_top_level_example_group(_node); end4659 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/top_level_group.rb:294660 def on_top_level_group(_node); end4661 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/top_level_group.rb:484662 def root_node; end4663 # @return [Boolean]4664 #4665 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/top_level_group.rb:314666 def top_level_group?(node); end4667 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/top_level_group.rb:354668 def top_level_nodes(node); end4669end4670# Checks for a specified error in checking raised errors.4671#4672# Enforces one of an Exception type, a string, or a regular4673# expression to match against the exception message as a parameter4674# to `raise_error`4675#4676# @example4677#4678# # bad4679# expect {4680# raise StandardError.new('error')4681# }.to raise_error4682#4683# # good4684# expect {4685# raise StandardError.new('error')4686# }.to raise_error(StandardError)4687#4688# expect {4689# raise StandardError.new('error')4690# }.to raise_error('error')4691#4692# expect {4693# raise StandardError.new('error')4694# }.to raise_error(/err/)4695#4696# expect { do_something }.not_to raise_error4697#4698# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/unspecified_exception.rb:334699class RuboCop::Cop::RSpec::UnspecifiedException < ::RuboCop::Cop::RSpec::Base4700 # @return [Boolean]4701 #4702 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/unspecified_exception.rb:574703 def block_with_args?(node); end4704 # @return [Boolean]4705 #4706 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/unspecified_exception.rb:534707 def empty_exception_matcher?(node); end4708 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/unspecified_exception.rb:384709 def empty_raise_error_or_exception(param0 = T.unsafe(nil)); end4710 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/unspecified_exception.rb:474711 def on_send(node); end4712end4713# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/unspecified_exception.rb:344714RuboCop::Cop::RSpec::UnspecifiedException::MSG = T.let(T.unsafe(nil), String)4715# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/unspecified_exception.rb:354716RuboCop::Cop::RSpec::UnspecifiedException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)4717# Helps check offenses with variable definitions4718#4719# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/variable.rb:74720module RuboCop::Cop::RSpec::Variable4721 extend ::RuboCop::AST::NodePattern::Macros4722 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/variable.rb:144723 def variable_definition?(param0 = T.unsafe(nil)); end4724end4725# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/variable.rb:114726RuboCop::Cop::RSpec::Variable::Helpers = RuboCop::RSpec::Language::Helpers4727# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/mixin/variable.rb:104728RuboCop::Cop::RSpec::Variable::Subjects = RuboCop::RSpec::Language::Subjects4729# Checks that memoized helpers names are symbols or strings.4730#4731# @example EnforcedStyle: symbols (default)4732# # bad4733# subject('user') { create_user }4734# let('user_name') { 'Adam' }4735#4736# # good4737# subject(:user) { create_user }4738# let(:user_name) { 'Adam' }4739# @example EnforcedStyle: strings4740# # bad4741# subject(:user) { create_user }4742# let(:user_name) { 'Adam' }4743#4744# # good4745# subject('user') { create_user }4746# let('user_name') { 'Adam' }4747#4748# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_definition.rb:254749class RuboCop::Cop::RSpec::VariableDefinition < ::RuboCop::Cop::RSpec::Base4750 include ::RuboCop::Cop::ConfigurableEnforcedStyle4751 include ::RuboCop::Cop::RSpec::Variable4752 extend ::RuboCop::Cop::AutoCorrector4753 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_definition.rb:324754 def on_send(node); end4755 private4756 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_definition.rb:474757 def correct_variable(variable); end4758 # @return [Boolean]4759 #4760 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_definition.rb:634761 def string?(node); end4762 # @return [Boolean]4763 #4764 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_definition.rb:584765 def style_violation?(variable); end4766 # @return [Boolean]4767 #4768 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_definition.rb:674769 def symbol?(node); end4770end4771# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_definition.rb:304772RuboCop::Cop::RSpec::VariableDefinition::MSG = T.let(T.unsafe(nil), String)4773# Checks that memoized helper names use the configured style.4774#4775# Variables can be excluded from checking using the `IgnoredPatterns`4776# option.4777#4778# @example EnforcedStyle: snake_case (default)4779# # bad4780# subject(:userName1) { 'Adam' }4781# let(:userName2) { 'Adam' }4782#4783# # good4784# subject(:user_name_1) { 'Adam' }4785# let(:user_name_2) { 'Adam' }4786# @example EnforcedStyle: camelCase4787# # bad4788# subject(:user_name_1) { 'Adam' }4789# let(:user_name_2) { 'Adam' }4790#4791# # good4792# subject(:userName1) { 'Adam' }4793# let(:userName2) { 'Adam' }4794# @example IgnoredPatterns configuration4795#4796# # rubocop.yml4797# # RSpec/VariableName:4798# # EnforcedStyle: snake_case4799# # IgnoredPatterns:4800# # - ^userFood4801# @example4802# # okay because it matches the `^userFood` regex in `IgnoredPatterns`4803# subject(:userFood_1) { 'spaghetti' }4804# let(:userFood_2) { 'fettuccine' }4805#4806# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_name.rb:424807class RuboCop::Cop::RSpec::VariableName < ::RuboCop::Cop::RSpec::Base4808 include ::RuboCop::Cop::ConfigurableEnforcedStyle4809 include ::RuboCop::Cop::ConfigurableFormatting4810 include ::RuboCop::Cop::ConfigurableNaming4811 include ::RuboCop::Cop::AllowedPattern4812 include ::RuboCop::Cop::RSpec::Variable4813 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_name.rb:494814 def on_send(node); end4815 private4816 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_name.rb:604817 def message(style); end4818end4819# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/variable_name.rb:474820RuboCop::Cop::RSpec::VariableName::MSG = T.let(T.unsafe(nil), String)4821# Checks for consistent verified double reference style.4822#4823# Only investigates references that are one of the supported styles.4824#4825# This cop can be configured in your configuration using the4826# `EnforcedStyle` option and supports `--auto-gen-config`.4827#4828# @example `EnforcedStyle: constant` (default)4829# # bad4830# let(:foo) do4831# instance_double('ClassName', method_name: 'returned_value')4832# end4833#4834# # good4835# let(:foo) do4836# instance_double(ClassName, method_name: 'returned_value')4837# end4838# @example `EnforcedStyle: string`4839# # bad4840# let(:foo) do4841# instance_double(ClassName, method_name: 'returned_value')4842# end4843#4844# # good4845# let(:foo) do4846# instance_double('ClassName', method_name: 'returned_value')4847# end4848# @example Reference is not in the supported style list. No enforcement4849#4850# # good4851# let(:foo) do4852# instance_double(@klass, method_name: 'returned_value')4853# end4854# @see https://relishapp.com/rspec/rspec-mocks/docs/verifying-doubles4855#4856# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/verified_double_reference.rb:434857class RuboCop::Cop::RSpec::VerifiedDoubleReference < ::RuboCop::Cop::RSpec::Base4858 include ::RuboCop::Cop::ConfigurableEnforcedStyle4859 extend ::RuboCop::Cop::AutoCorrector4860 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/verified_double_reference.rb:744861 def on_send(node); end4862 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/verified_double_reference.rb:664863 def verified_double(param0 = T.unsafe(nil)); end4864 private4865 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/verified_double_reference.rb:1014866 def correct_style(violation); end4867 # @return [Boolean]4868 #4869 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/verified_double_reference.rb:924870 def opposing_style?(class_reference); end4871end4872# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/verified_double_reference.rb:474873RuboCop::Cop::RSpec::VerifiedDoubleReference::MSG = T.let(T.unsafe(nil), String)4874# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/verified_double_reference.rb:604875RuboCop::Cop::RSpec::VerifiedDoubleReference::REFERENCE_TYPE_STYLES = T.let(T.unsafe(nil), Hash)4876# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/verified_double_reference.rb:494877RuboCop::Cop::RSpec::VerifiedDoubleReference::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set)4878# Prefer using verifying doubles over normal doubles.4879#4880# @example4881# # bad4882# let(:foo) do4883# double(method_name: 'returned value')4884# end4885#4886# # bad4887# let(:foo) do4888# double("ClassName", method_name: 'returned value')4889# end4890#4891# # good4892# let(:foo) do4893# instance_double("ClassName", method_name: 'returned value')4894# end4895# @see https://relishapp.com/rspec/rspec-mocks/docs/verifying-doubles4896#4897# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/verified_doubles.rb:254898class RuboCop::Cop::RSpec::VerifiedDoubles < ::RuboCop::Cop::RSpec::Base4899 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/verified_doubles.rb:344900 def on_send(node); end4901 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/verified_doubles.rb:304902 def unverified_double(param0 = T.unsafe(nil)); end4903 private4904 # @return [Boolean]4905 #4906 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/verified_doubles.rb:454907 def symbol?(name); end4908end4909# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/verified_doubles.rb:264910RuboCop::Cop::RSpec::VerifiedDoubles::MSG = T.let(T.unsafe(nil), String)4911# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/verified_doubles.rb:274912RuboCop::Cop::RSpec::VerifiedDoubles::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)4913# Checks void `expect()`.4914#4915# @example4916# # bad4917# expect(something)4918#4919# # good4920# expect(something).to be(1)4921#4922# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/void_expect.rb:144923class RuboCop::Cop::RSpec::VoidExpect < ::RuboCop::Cop::RSpec::Base4924 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/void_expect.rb:204925 def expect?(param0 = T.unsafe(nil)); end4926 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/void_expect.rb:254927 def expect_block?(param0 = T.unsafe(nil)); end4928 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/void_expect.rb:354929 def on_block(node); end4930 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/void_expect.rb:294931 def on_send(node); end4932 private4933 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/void_expect.rb:434934 def check_expect(node); end4935 # @return [Boolean]4936 #4937 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/void_expect.rb:494938 def void?(expect); end4939end4940# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/void_expect.rb:154941RuboCop::Cop::RSpec::VoidExpect::MSG = T.let(T.unsafe(nil), String)4942# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/void_expect.rb:174943RuboCop::Cop::RSpec::VoidExpect::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)4944# Checks for calling a block within a stub.4945#4946# @example4947# # bad4948# allow(foo).to receive(:bar) { |&block| block.call(1) }4949#4950# # good4951# expect(foo).to receive(:bar).and_yield(1)4952#4953# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/yield.rb:144954class RuboCop::Cop::RSpec::Yield < ::RuboCop::Cop::RSpec::Base4955 include ::RuboCop::Cop::RangeHelp4956 extend ::RuboCop::Cop::AutoCorrector4957 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/yield.rb:244958 def block_arg(param0 = T.unsafe(nil)); end4959 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/yield.rb:274960 def block_call?(param0 = T.unsafe(nil), param1); end4961 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/yield.rb:214962 def method_on_stub?(param0); end4963 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/yield.rb:294964 def on_block(node); end4965 private4966 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/yield.rb:454967 def autocorrect(corrector, node, range); end4968 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/yield.rb:604969 def block_range(node); end4970 # @return [Boolean]4971 #4972 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/yield.rb:524973 def calling_block?(node, block); end4974 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/yield.rb:724975 def convert_block_to_yield(node); end4976 # source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/yield.rb:644977 def generate_replacement(node); end4978end4979# source://rubocop-rspec-2.12.1/lib/rubocop/cop/rspec/yield.rb:184980RuboCop::Cop::RSpec::Yield::MSG = T.let(T.unsafe(nil), String)4981module RuboCop::Cop::Style; end4982# Checks for trailing comma in argument lists.4983# The supported styles are:4984#4985# * `consistent_comma`: Requires a comma after the last argument,4986# for all parenthesized method calls with arguments.4987# * `comma`: Requires a comma after the last argument, but only for4988# parenthesized method calls where each argument is on its own line.4989# * `no_comma`: Requires that there is no comma after the last4990# argument.4991#4992# @example EnforcedStyleForMultiline: consistent_comma4993# # bad4994# method(1, 2,)4995#4996# # good4997# method(1, 2)4998#4999# # good5000# method(5001# 1, 2,5002# 3,...

Full Screen

Full Screen

style.rb

Source:style.rb Github

copy

Full Screen

...6 def check_style_and_print(files, options = {})7 check_style_impl(files, :print, options)8 end9 # Checks style for a list of files, returning results as a RubocopResults10 # object parsed from its JSON output.11 def check_style_json(files, options = {})12 check_style_impl(files, :json, options)13 end14 def check_style_impl(files, output_type, options = {})15 fix = options[:fix]16 Homebrew.install_gem_setup_path! "rubocop", HOMEBREW_RUBOCOP_VERSION17 require "rubocop"18 require "rubocops"19 args = %w[20 --force-exclusion21 ]22 if fix23 args << "--auto-correct"24 else25 args << "--parallel"26 end27 if ARGV.include?("--rspec")28 Homebrew.install_gem! "rubocop-rspec"29 args += %w[--require rubocop-rspec]30 end31 if options[:except_cops]32 options[:except_cops].map! { |cop| RuboCop::Cop::Cop.registry.qualified_cop_name(cop.to_s, "") }33 cops_to_exclude = options[:except_cops].select do |cop|34 RuboCop::Cop::Cop.registry.names.include?(cop) ||35 RuboCop::Cop::Cop.registry.departments.include?(cop.to_sym)36 end37 args << "--except" << cops_to_exclude.join(",") unless cops_to_exclude.empty?38 elsif options[:only_cops]39 options[:only_cops].map! { |cop| RuboCop::Cop::Cop.registry.qualified_cop_name(cop.to_s, "") }40 cops_to_include = options[:only_cops].select do |cop|41 RuboCop::Cop::Cop.registry.names.include?(cop) ||42 RuboCop::Cop::Cop.registry.departments.include?(cop.to_sym)43 end44 if cops_to_include.empty?45 odie "RuboCops #{options[:only_cops].join(",")} were not found"46 end47 args << "--only" << cops_to_include.join(",")48 end49 has_non_formula = Array(files).any? do |file|50 File.expand_path(file).start_with? HOMEBREW_LIBRARY_PATH51 end52 config_file = if files.nil? || has_non_formula53 if ARGV.include?("--rspec")54 HOMEBREW_LIBRARY_PATH/".rubocop-rspec.yml"55 else56 HOMEBREW_LIBRARY_PATH/".rubocop.yml"57 end58 else59 HOMEBREW_LIBRARY/".rubocop_audit.yml"60 end61 args << "--config" << config_file62 if files.nil?63 args << HOMEBREW_LIBRARY_PATH64 else65 args += files66 end67 cache_env = { "XDG_CACHE_HOME" => "#{HOMEBREW_CACHE}/style" }68 case output_type69 when :print70 args << "--debug" if ARGV.debug?71 args << "--display-cop-names" if ARGV.include? "--display-cop-names"72 args << "--format" << "simple" if files73 system(cache_env, "rubocop", "_#{HOMEBREW_RUBOCOP_VERSION}_", *args)74 !$CHILD_STATUS.success?75 when :json76 json, err, status = Open3.capture3(cache_env, "rubocop", "_#{HOMEBREW_RUBOCOP_VERSION}_", "--format", "json", *args)77 # exit status of 1 just means violations were found; other numbers mean78 # execution errors.79 # exitstatus can also be nil if RuboCop process crashes, e.g. due to80 # native extension problems.81 # JSON needs to be at least 2 characters.82 if !(0..1).cover?(status.exitstatus) || json.to_s.length < 283 raise "Error running `rubocop --format json #{args.join " "}`\n#{err}"84 end85 RubocopResults.new(JSON.parse(json))86 else87 raise "Invalid output_type for check_style_impl: #{output_type}"88 end89 end90 class RubocopResults91 def initialize(json)92 @metadata = json["metadata"]93 @file_offenses = {}94 json["files"].each do |f|95 next if f["offenses"].empty?96 file = File.realpath(f["path"])...

Full Screen

Full Screen

its

Using AI Code Generation

copy

Full Screen

1 MSG = 'Use `is_expected` instead of `expect(subject)`.'.freeze2 (send nil? :expect (send nil? :subject))3 def on_send(node)4 return unless example_group?(node)5 return if top_level_describe?(node)6 expect_subject(child) do7 add_offense(child, :expression, MSG)8 def autocorrect(node)9 corrector.replace(node.loc.expression, 'is_expected')10 MSG = 'Use `is_expected` instead of `expect(subject)`.'.freeze11 (send nil? :expect (send nil? :subject))12 def on_send(node)13 return unless example_group?(node)14 return if top_level_describe?(node)15 expect_subject(child) do16 add_offense(child, :expression, MSG)17 def autocorrect(node)18 corrector.replace(node.loc.expression, 'is_expected')

Full Screen

Full Screen

its

Using AI Code Generation

copy

Full Screen

1 (block2 (send3 (begin))4 def on_block(node)5 empty_group?(node) do |group|6 add_offense(group, location: :selector)

Full Screen

Full Screen

its

Using AI Code Generation

copy

Full Screen

1 def on_send(node)2 add_offense(node, :expression, MSG)3 def on_send(node)4 add_offense(node, :expression, MSG)5 def on_send(node)6 add_offense(node, :expression, MSG)7 def on_send(node)8 add_offense(node, :expression, MSG)

Full Screen

Full Screen

its

Using AI Code Generation

copy

Full Screen

1 def on_send(node)2 def on_send(node)3 def on_send(node)4 def on_send(node)5 def on_send(node)6 def on_send(node)

Full Screen

Full Screen

its

Using AI Code Generation

copy

Full Screen

1 def on_send(node)2 return unless subject_declaration?(node)3 return unless single_line_break_after_subject?(node)4 add_offense(node, location: :expression)5 def single_line_break_after_subject?(node)6 def subject_declaration?(node)7 subject { 'foo' }8 def on_send(node)9 return unless subject_declaration?(node)10 return unless single_line_break_after_subject?(node)11 add_offense(node, location: :expression)12 def single_line_break_after_subject?(node)13 def subject_declaration?(node)

Full Screen

Full Screen

its

Using AI Code Generation

copy

Full Screen

1 (block2 (send3 (begin))4 def on_block(node)5 empty_group?(node) do |group|6 add_offense(group, location: :selector)

Full Screen

Full Screen

its

Using AI Code Generation

copy

Full Screen

1 def on_send(node)2 def on_send(node)3 def on_send(node)4 def on_send(node)5 def on_send(node)6 def on_send(node)

Full Screen

Full Screen

its

Using AI Code Generation

copy

Full Screen

1 def on_send(node)2 return unless subject_declaration?(node)3 return unless single_line_break_after_subject?(node)4 add_offense(node, location: :expression)5 def single_line_break_after_subject?(node)6 def subject_declaration?(node)7 subject { 'foo' }8 def on_send(node)9 return unless subject_declaration?(node)10 return unless single_line_break_after_subject?(node)11 add_offense(node, location: :expression)12 def single_line_break_after_subject?(node)13 def subject_declaration?(node)

Full Screen

Full Screen

its

Using AI Code Generation

copy

Full Screen

1 (block2 (send3 (begin))4 def on_block(node)5 empty_group?(node) do |group|6 add_offense(group, location: :selector)

Full Screen

Full Screen

its

Using AI Code Generation

copy

Full Screen

1 def on_send(node)2 def on_send(node)3 def on_send(node)4 def on_send(node)5 def on_send(node)6 def on_send(node)

Full Screen

Full Screen

its

Using AI Code Generation

copy

Full Screen

1 def on_send(node)2 return unless subject_declaration?(node)3 return unless single_line_break_after_subject?(node)4 add_offense(node, location: :expression)5 def single_line_break_after_subject?(node)6 def subject_declaration?(node)7 subject { 'foo' }8 def on_send(node)9 return unless subject_declaration?(node)10 return unless single_line_break_after_subject?(node)11 add_offense(node, location: :expression)12 def single_line_break_after_subject?(node)13 def subject_declaration?(node)

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful