File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
spec/rubocop/cop/rspec/factory_bot Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 17
17
end
18
18
19
19
it "registers an offense for `FactoryBot.#{ method } `" do
20
- expect_offense ( <<~RUBY )
20
+ expect_offense ( <<~RUBY , method : method )
21
21
describe Foo do
22
- let(:bar) { FactoryBot.# {method } (:bar) }
23
- ^^^^^^^^^^^#{ '^' * method . length } Use `# {method } ` from `FactoryBot::Syntax::Methods`.
22
+ let(:bar) { FactoryBot.% {method}(:bar) }
23
+ ^^^^^^^^^^^^{ method} Use `% {method}` from `FactoryBot::Syntax::Methods`.
24
24
end
25
25
RUBY
26
26
32
32
end
33
33
34
34
it "registers an offense for `FactoryBot.#{ method } ` in a shared group" do
35
- expect_offense ( <<~RUBY )
35
+ expect_offense ( <<~RUBY , method : method )
36
36
shared_examples_for Foo do
37
- let(:bar) { FactoryBot.# {method } (:bar) }
38
- ^^^^^^^^^^^#{ '^' * method . length } Use `# {method } ` from `FactoryBot::Syntax::Methods`.
37
+ let(:bar) { FactoryBot.% {method}(:bar) }
38
+ ^^^^^^^^^^^^{ method} Use `% {method}` from `FactoryBot::Syntax::Methods`.
39
39
end
40
40
RUBY
41
41
47
47
end
48
48
49
49
it "registers an offense for `::FactoryBot.#{ method } `" do
50
- expect_offense ( <<~RUBY )
50
+ expect_offense ( <<~RUBY , method : method )
51
51
RSpec.describe Foo do
52
- let(:bar) { ::FactoryBot.# {method } (:bar) }
53
- ^^^^^^^^^^^^^#{ '^' * method . length } Use `# {method } ` from `FactoryBot::Syntax::Methods`.
52
+ let(:bar) { ::FactoryBot.% {method}(:bar) }
53
+ ^^^^^^^^^^^^^^{ method} Use `% {method}` from `FactoryBot::Syntax::Methods`.
54
54
end
55
55
RUBY
56
56
You can’t perform that action at this time.
0 commit comments