Skip to content

Commit 7d926e7

Browse files
committed
fixup! Use plural for 'examples'
1 parent 97c1dbb commit 7d926e7

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

config/default.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ RSpec:
6161
- all
6262
- suite
6363
Includes:
64-
Example:
64+
Examples:
6565
- it_behaves_like
6666
- it_should_behave_like
6767
- include_examples
@@ -72,7 +72,7 @@ RSpec:
7272
- to_not
7373
- not_to
7474
SharedGroups:
75-
Example:
75+
Examples:
7676
- shared_examples
7777
- shared_examples_for
7878
Context:

lib/rubocop/cop/rspec/hooks_before_examples.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class HooksBeforeExamples < Base
3131
def_node_matcher :example_or_group?, <<-PATTERN
3232
{
3333
#{block_pattern('{#ExampleGroups.all #Examples.all}')}
34-
#{send_pattern('#Includes.example')}
34+
#{send_pattern('#Includes.examples')}
3535
}
3636
PATTERN
3737

lib/rubocop/cop/rspec/let_before_examples.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class LetBeforeExamples < Base
3838
def_node_matcher :example_or_group?, <<-PATTERN
3939
{
4040
#{block_pattern('{#ExampleGroups.all #Examples.all}')}
41-
#{send_pattern('#Includes.example')}
41+
#{send_pattern('#Includes.examples')}
4242
}
4343
PATTERN
4444

lib/rubocop/cop/rspec/named_subject.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class NamedSubject < Base
4848
block_pattern('{#Examples.all #Hooks.all}')
4949

5050
def_node_matcher :shared_example?,
51-
block_pattern('#SharedGroups.example')
51+
block_pattern('#SharedGroups.examples')
5252

5353
def_node_search :subject_usage, '$(send nil? :subject)'
5454

lib/rubocop/cop/rspec/repeated_include_example.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ class RepeatedIncludeExample < Base
5555
PATTERN
5656

5757
def_node_matcher :include_examples?,
58-
send_pattern('#Includes.example')
58+
send_pattern('#Includes.examples')
5959

6060
def_node_matcher :shared_examples_name, <<-PATTERN
61-
(send _ #Includes.example $_ ...)
61+
(send _ #Includes.examples $_ ...)
6262
PATTERN
6363

6464
def on_begin(node)

lib/rubocop/cop/rspec/shared_context.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class SharedContext < Base
6060
'define examples.'
6161

6262
def_node_search :examples?,
63-
send_pattern('{#Includes.example #Examples.all}')
63+
send_pattern('{#Includes.examples #Examples.all}')
6464

6565
def_node_search :context?, <<-PATTERN
6666
(
@@ -76,7 +76,7 @@ class SharedContext < Base
7676
def_node_matcher :shared_context,
7777
block_pattern('#SharedGroups.context')
7878
def_node_matcher :shared_example,
79-
block_pattern('#SharedGroups.example')
79+
block_pattern('#SharedGroups.examples')
8080

8181
def on_block(node)
8282
context_with_only_examples(node) do

lib/rubocop/rspec/language.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ def self.all(element)
133133
module Includes # :nodoc:
134134
class << self
135135
def all(element)
136-
example(element) ||
136+
examples(element) ||
137137
context(element)
138138
end
139139

140-
def example(element)
141-
Language.config['Includes']['Example'].include?(element.to_s)
140+
def examples(element)
141+
Language.config['Includes']['Examples'].include?(element.to_s)
142142
end
143143

144144
def context(element)
@@ -156,12 +156,12 @@ def self.all(element)
156156
module SharedGroups # :nodoc:
157157
class << self
158158
def all(element)
159-
example(element) ||
159+
examples(element) ||
160160
context(element)
161161
end
162162

163-
def example(element)
164-
Language.config['SharedGroups']['Example'].include?(element.to_s)
163+
def examples(element)
164+
Language.config['SharedGroups']['Examples'].include?(element.to_s)
165165
end
166166

167167
def context(element)

0 commit comments

Comments
 (0)